Collaboration diagram for Binary-coded decimal (BCD) API:

Functions

RDM_RETCODE rdm_bcdAdd (const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers. More...
RDM_RETCODE rdm_bcdAddInt32 (const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers. More...
RDM_RETCODE rdm_bcdAddInt64 (const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers. More...
RDM_RETCODE rdm_bcdAddUInt32 (const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers. More...
RDM_RETCODE rdm_bcdAddUInt64 (const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers. More...
RDM_RETCODE rdm_bcdAdjust (RDM_BCD_T *argument, uint8_t precision, uint8_t scale)
Adjust a BCD number. More...
RDM_RETCODE rdm_bcdCeiling (const RDM_BCD_T *operand, RDM_BCD_T *result)
Take the ceiling of a number. More...
RDM_RETCODE rdm_bcdChgSign (const RDM_BCD_T *operand, RDM_BCD_T *result)
Change the sign of a number. More...
RDM_COMPARE rdm_bcdCompare (const RDM_BCD_T *operand1, const RDM_BCD_T *operand2)
Compare two numbers. More...
void rdm_bcdCopy (const RDM_BCD_T *source, RDM_BCD_T *result)
Copy a BCD number. More...
RDM_RETCODE rdm_bcdDiv (const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
RDM_RETCODE rdm_bcdDivByInt32 (const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
RDM_RETCODE rdm_bcdDivByInt64 (const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
RDM_RETCODE rdm_bcdDivByUInt32 (const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
RDM_RETCODE rdm_bcdDivByUInt64 (const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
RDM_RETCODE rdm_bcdDivInt32 (int32_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
RDM_RETCODE rdm_bcdDivInt64 (int64_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
RDM_RETCODE rdm_bcdDivUInt32 (uint32_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
RDM_RETCODE rdm_bcdDivUInt64 (uint64_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
RDM_RETCODE rdm_bcdFloor (const RDM_BCD_T *operand, RDM_BCD_T *result)
Take the floor of a number. More...
RDM_RETCODE rdm_bcdFromDouble (double operand, RDM_BCD_T *result)
Convert a double to a BCD number. More...
RDM_RETCODE rdm_bcdFromFloat (float operand, RDM_BCD_T *result)
Convert a float to a BCD number. More...
RDM_RETCODE rdm_bcdFromInt16 (int16_t operand, RDM_BCD_T *result)
Convert an int16_t to a BCD number. More...
RDM_RETCODE rdm_bcdFromInt32 (int32_t operand, RDM_BCD_T *result)
Convert an int32_t to a BCD number. More...
RDM_RETCODE rdm_bcdFromInt64 (int64_t operand, RDM_BCD_T *result)
Convert an int64_t to a BCD number. More...
RDM_RETCODE rdm_bcdFromInt8 (int8_t operand, RDM_BCD_T *result)
Convert an int8_t to a BCD number. More...
RDM_RETCODE rdm_bcdFromString (const char *operand, RDM_BCD_T *result)
Convert a string to a BCD number. More...
RDM_RETCODE rdm_bcdFromUInt16 (uint16_t operand, RDM_BCD_T *result)
Convert an uint16_t to a BCD number. More...
RDM_RETCODE rdm_bcdFromUInt32 (uint32_t operand, RDM_BCD_T *result)
Convert an uint32_t to a BCD number. More...
RDM_RETCODE rdm_bcdFromUInt64 (uint64_t operand, RDM_BCD_T *result)
Convert an uint64_t to a BCD number. More...
RDM_RETCODE rdm_bcdFromUInt8 (uint8_t operand, RDM_BCD_T *result)
Convert an uint8_t to a BCD number. More...
bool rdm_bcdIsZero (const RDM_BCD_T *argument)
Is a number zero. More...
uint8_t rdm_bcdMaxprec (void)
Return the maximum precision. More...
uint8_t rdm_bcdMaxscale (void)
Return the scale. More...
RDM_RETCODE rdm_bcdMult (const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers. More...
RDM_RETCODE rdm_bcdMultInt32 (const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers. More...
RDM_RETCODE rdm_bcdMultInt64 (const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers. More...
RDM_RETCODE rdm_bcdMultUInt32 (const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers. More...
RDM_RETCODE rdm_bcdMultUInt64 (const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers. More...
RDM_RETCODE rdm_bcdReciprocal (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the reciprocal of a number. More...
RDM_RETCODE rdm_bcdRound (const RDM_BCD_T *operand, RDM_BCD_T *result)
Find the nearest integer of a BCD number. More...
int16_t rdm_bcdSign (const RDM_BCD_T *argument)
Get the sign of a number. More...
RDM_RETCODE rdm_bcdSub (const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubFromInt32 (int32_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubFromInt64 (int64_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubFromUInt32 (uint32_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubFromUInt64 (uint64_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubInt32 (const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubInt64 (const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubUInt32 (const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubUInt64 (const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdToDouble (const RDM_BCD_T *operand, double *result)
Convert a BCD number to a double. More...
RDM_RETCODE rdm_bcdToFloat (const RDM_BCD_T *operand, float *result)
Convert a BCD number to a float. More...
RDM_RETCODE rdm_bcdToInt16 (const RDM_BCD_T *operand, int16_t *result)
Convert a BCD number to an int16_t. More...
RDM_RETCODE rdm_bcdToInt32 (const RDM_BCD_T *operand, int32_t *result)
Convert a BCD number to an int32_t. More...
RDM_RETCODE rdm_bcdToInt64 (const RDM_BCD_T *operand, int64_t *result)
Convert a BCD number to an int64_t. More...
RDM_RETCODE rdm_bcdToInt8 (const RDM_BCD_T *operand, int8_t *result)
Convert a BCD number to an int8_t. More...
RDM_RETCODE rdm_bcdToString (const RDM_BCD_T *operand, bool useExponent, char *result, size_t inBytes, size_t *bytesOut)
Convert a BCD number to a string. More...
RDM_RETCODE rdm_bcdToStringWithScale (const RDM_BCD_T *operand, uint8_t scale, bool useExponent, char *result, size_t inBytes, size_t *bytesOut)
Convert a BCD number with scale to a string. More...
RDM_RETCODE rdm_bcdToUInt16 (const RDM_BCD_T *operand, uint16_t *result)
Convert a BCD number to an uint16_t. More...
RDM_RETCODE rdm_bcdToUInt32 (const RDM_BCD_T *operand, uint32_t *result)
Convert a BCD number to an uint32_t. More...
RDM_RETCODE rdm_bcdToUInt64 (const RDM_BCD_T *operand, uint64_t *result)
Convert a BCD number to an uint64_t. More...
RDM_RETCODE rdm_bcdToUInt8 (const RDM_BCD_T *operand, uint8_t *result)
Convert a BCD number to an uint8_t. More...

Detailed Description

The RaimaDB BCD datatype API. The functions here are located in RaimaDB Base Functionality. Linker option:

    -lrdmbase

Function Documentation

rdm_bcdAdd()

RDM_RETCODE rdm_bcdAdd ( const RDM_BCD_T * operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Add two numbers.

This function adds two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdAddInt32()

RDM_RETCODE rdm_bcdAddInt32 ( const RDM_BCD_T * operand1,
int32_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Add two numbers.

This function adds two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdAddInt64()

RDM_RETCODE rdm_bcdAddInt64 ( const RDM_BCD_T * operand1,
int64_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Add two numbers.

This function adds two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdAddUInt32()

RDM_RETCODE rdm_bcdAddUInt32 ( const RDM_BCD_T * operand1,
uint32_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Add two numbers.

This function adds two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdAddUInt64()

RDM_RETCODE rdm_bcdAddUInt64 ( const RDM_BCD_T * operand1,
uint64_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Add two numbers.

This function adds two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdAdjust()

RDM_RETCODE rdm_bcdAdjust ( RDM_BCD_T * argument,
uint8_t precision,
uint8_t scale
)

#include <rdmbcdapi.h>

Adjust a BCD number.

This function adjusts a BCD number to the given precision and scale.

Return values
sOKAY Normal, successful return.
Parameters
argument [in/out] Argument to be adjusted
[in] precision The precision to be used. The max precission is RDM_BCD_MAXPRECISION
[in] scale The scale to be used. The max scale is RDM_BCD_MAXSCALE

rdm_bcdCeiling()

RDM_RETCODE rdm_bcdCeiling ( const RDM_BCD_T * operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Take the ceiling of a number.

This function returns in result the nearest integer greater than or equal to operand.

Return values
sOKAY Normal, successful return.
Parameters
[in] operand Operand for the calculation
[out] result Result of the calculation

rdm_bcdChgSign()

RDM_RETCODE rdm_bcdChgSign ( const RDM_BCD_T * operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Change the sign of a number.

This function changes the sign of a BCD number.

Return values
sOKAY Normal, successful return.
Parameters
[in] operand Operand for the calculation
[out] result Result of the calculation

rdm_bcdCompare()

RDM_COMPARE rdm_bcdCompare ( const RDM_BCD_T * operand1,
const RDM_BCD_T * operand2
)

#include <rdmbcdapi.h>

Compare two numbers.

This function compare two BCD numbers and return the result as an RDM_COMPARE.

Returns
RDM_COMPARE
Return values
RDM_LT The first argument is lesser than the second argument
RDM_EQ The arguments are equal
RDM_GT The first argument is greater than the second argument
Parameters
[in] operand1 First operand for the comparison
[in] operand2 Second operand for the comparison

rdm_bcdCopy()

void rdm_bcdCopy ( const RDM_BCD_T * source,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Copy a BCD number.

This function makes a copy of a BCD number.

Parameters
[in] source Source to be copied
[out] result Result copy

rdm_bcdDiv()

RDM_RETCODE rdm_bcdDiv ( const RDM_BCD_T * operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdDivByInt32()

RDM_RETCODE rdm_bcdDivByInt32 ( const RDM_BCD_T * operand1,
int32_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Divide two numbers.

This function divides two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdDivByInt64()

RDM_RETCODE rdm_bcdDivByInt64 ( const RDM_BCD_T * operand1,
int64_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Divide two numbers.

This function divides two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdDivByUInt32()

RDM_RETCODE rdm_bcdDivByUInt32 ( const RDM_BCD_T * operand1,
uint32_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Divide two numbers.

This function divides two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdDivByUInt64()

RDM_RETCODE rdm_bcdDivByUInt64 ( const RDM_BCD_T * operand1,
uint64_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Divide two numbers.

This function divides two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdDivInt32()

RDM_RETCODE rdm_bcdDivInt32 ( int32_t operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Divide two numbers.

This function divides two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdDivInt64()

RDM_RETCODE rdm_bcdDivInt64 ( int64_t operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Divide two numbers.

This function divides two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdDivUInt32()

RDM_RETCODE rdm_bcdDivUInt32 ( uint32_t operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Divide two numbers.

This function divides two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdDivUInt64()

RDM_RETCODE rdm_bcdDivUInt64 ( uint64_t operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Divide two numbers.

This function divides two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdFloor()

RDM_RETCODE rdm_bcdFloor ( const RDM_BCD_T * operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Take the floor of a number.

This function returns in result the nearest integer less than or equal to operand.

Return values
sOKAY Success
Parameters
[in] operand Operand for the calculation
[out] result Result of the calculation

rdm_bcdFromDouble()

RDM_RETCODE rdm_bcdFromDouble ( double operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert a double to a BCD number.

This function converts a double to BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion
Examples
core18Example_main.c.

rdm_bcdFromFloat()

RDM_RETCODE rdm_bcdFromFloat ( float operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert a float to a BCD number.

This function converts a number given in a float argument to BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdFromInt16()

RDM_RETCODE rdm_bcdFromInt16 ( int16_t operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert an int16_t to a BCD number.

This function converts an int16_t to a BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdFromInt32()

RDM_RETCODE rdm_bcdFromInt32 ( int32_t operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert an int32_t to a BCD number.

This function converts an int32_t to a BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion
Examples
core18Example_main.c.

rdm_bcdFromInt64()

RDM_RETCODE rdm_bcdFromInt64 ( int64_t operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert an int64_t to a BCD number.

This function converts an int64_t to a BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdFromInt8()

RDM_RETCODE rdm_bcdFromInt8 ( int8_t operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert an int8_t to a BCD number.

This function converts an int8_t argument to BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdFromString()

RDM_RETCODE rdm_bcdFromString ( const char * operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert a string to a BCD number.

This function converts a number given in a string argument to BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion
Examples
core18Example_main.c, learn/bookStore_client.c, learn/bookStore_embed.c, and learn/bookStore_vxWorks7.c.

rdm_bcdFromUInt16()

RDM_RETCODE rdm_bcdFromUInt16 ( uint16_t operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert an uint16_t to a BCD number.

This function converts an uint16_t to a BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdFromUInt32()

RDM_RETCODE rdm_bcdFromUInt32 ( uint32_t operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert an uint32_t to a BCD number.

This function converts an uint32_t to a BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdFromUInt64()

RDM_RETCODE rdm_bcdFromUInt64 ( uint64_t operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert an uint64_t to a BCD number.

This function converts an uint64_t to a BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdFromUInt8()

RDM_RETCODE rdm_bcdFromUInt8 ( uint8_t operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Convert an uint8_t to a BCD number.

This function converts an uint8_t to a BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdIsZero()

bool rdm_bcdIsZero ( const RDM_BCD_T * argument )

#include <rdmbcdapi.h>

Is a number zero.

This function returns wether the BCD number is zero or not

Returns
bool
Return values
true The number is zero
false The number is not zero
Parameters
[in] argument The argument that is checked

rdm_bcdMaxprec()

uint8_t rdm_bcdMaxprec ( void )

#include <rdmbcdapi.h>

Return the maximum precision.

This function returns the maximum precision for a BCD number.

Returns
Max precision
Return values
RDM_BCD_MAXPRECISION

rdm_bcdMaxscale()

uint8_t rdm_bcdMaxscale ( void )

#include <rdmbcdapi.h>

Return the scale.

This function returns the scale for a BCD number.

Returns
Max scale
Return values
RDM_BCD_MAXSCALE

rdm_bcdMult()

RDM_RETCODE rdm_bcdMult ( const RDM_BCD_T * operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Multiply two numbers.

This function multiplies two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdMultInt32()

RDM_RETCODE rdm_bcdMultInt32 ( const RDM_BCD_T * operand1,
int32_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Multiply two numbers.

This function multiplies two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdMultInt64()

RDM_RETCODE rdm_bcdMultInt64 ( const RDM_BCD_T * operand1,
int64_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Multiply two numbers.

This function multiplies two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdMultUInt32()

RDM_RETCODE rdm_bcdMultUInt32 ( const RDM_BCD_T * operand1,
uint32_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Multiply two numbers.

This function multiplies two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdMultUInt64()

RDM_RETCODE rdm_bcdMultUInt64 ( const RDM_BCD_T * operand1,
uint64_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Multiply two numbers.

This function multiplies two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdReciprocal()

RDM_RETCODE rdm_bcdReciprocal ( const RDM_BCD_T * operand,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Take the reciprocal of a number.

This function takes the reciprocal of a BCD number.

Return values
sOKAY Success
Parameters
[in] operand Operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdRound()

RDM_RETCODE rdm_bcdRound ( const RDM_BCD_T * operand,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Find the nearest integer of a BCD number.

This function rounds result up or down to the nearest integer from the input operand.

Return values
sOKAY Success
Parameters
[in] operand Operand for the calculation
[out] result Result of the calculation

rdm_bcdSign()

int16_t rdm_bcdSign ( const RDM_BCD_T * argument )

#include <rdmbcdapi.h>

Get the sign of a number.

This function returnes the sign of a BCD number.

Returns
a int16_t
Return values
1 A positive number
0 A number equal to 0
-1 A negative number
Parameters
[in] argument The argument that is checked

rdm_bcdSub()

RDM_RETCODE rdm_bcdSub ( const RDM_BCD_T * operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdSubFromInt32()

RDM_RETCODE rdm_bcdSubFromInt32 ( int32_t operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdSubFromInt64()

RDM_RETCODE rdm_bcdSubFromInt64 ( int64_t operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdSubFromUInt32()

RDM_RETCODE rdm_bcdSubFromUInt32 ( uint32_t operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdSubFromUInt64()

RDM_RETCODE rdm_bcdSubFromUInt64 ( uint64_t operand1,
const RDM_BCD_T * operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdSubInt32()

RDM_RETCODE rdm_bcdSubInt32 ( const RDM_BCD_T * operand1,
int32_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdSubInt64()

RDM_RETCODE rdm_bcdSubInt64 ( const RDM_BCD_T * operand1,
int64_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdSubUInt32()

RDM_RETCODE rdm_bcdSubUInt32 ( const RDM_BCD_T * operand1,
uint32_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdSubUInt64()

RDM_RETCODE rdm_bcdSubUInt64 ( const RDM_BCD_T * operand1,
uint64_t operand2,
RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * result
)

#include <rdmbcdapi.h>

Subtract two numbers.

This function subtracts two numbers of the specified types.

Return values
sOKAY Success
Parameters
[in] operand1 First operand for the calculation
[in] operand2 Second operand for the calculation
[in] rounding_mode rounding mode
[out] result Result of the calculation

rdm_bcdToDouble()

RDM_RETCODE rdm_bcdToDouble ( const RDM_BCD_T * operand,
double * result
)

#include <rdmbcdapi.h>

Convert a BCD number to a double.

This function converts a BCD number to a double.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToFloat()

RDM_RETCODE rdm_bcdToFloat ( const RDM_BCD_T * operand,
float * result
)

#include <rdmbcdapi.h>

Convert a BCD number to a float.

This function converts a BCD number to a float.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToInt16()

RDM_RETCODE rdm_bcdToInt16 ( const RDM_BCD_T * operand,
int16_t * result
)

#include <rdmbcdapi.h>

Convert a BCD number to an int16_t.

This function converts a BCD number to an int16_t.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToInt32()

RDM_RETCODE rdm_bcdToInt32 ( const RDM_BCD_T * operand,
int32_t * result
)

#include <rdmbcdapi.h>

Convert a BCD number to an int32_t.

This function converts a BCD number to an int32_t.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToInt64()

RDM_RETCODE rdm_bcdToInt64 ( const RDM_BCD_T * operand,
int64_t * result
)

#include <rdmbcdapi.h>

Convert a BCD number to an int64_t.

This function converts a BCD number to an int64_t.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToInt8()

RDM_RETCODE rdm_bcdToInt8 ( const RDM_BCD_T * operand,
int8_t * result
)

#include <rdmbcdapi.h>

Convert a BCD number to an int8_t.

This function converts a BCD number to an int8_t.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToString()

RDM_RETCODE rdm_bcdToString ( const RDM_BCD_T * operand,
bool useExponent,
char * result,
size_t inBytes,
size_t * bytesOut
)

#include <rdmbcdapi.h>

Convert a BCD number to a string.

This function converts a BCD number to a string.

The number of bytes needed for the conversion can be retrieved through

bytesOut by setting result to NULL.
Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
useExponent [IN] Use exponent in output
[out] result Result of the conversion
[in] inBytes Length of result buffer in bytes
[out] bytesOut A pointer to the number of bytes returned (can be NULL)
Examples
core18Example_main.c.

rdm_bcdToStringWithScale()

RDM_RETCODE rdm_bcdToStringWithScale ( const RDM_BCD_T * operand,
uint8_t scale,
bool useExponent,
char * result,
size_t inBytes,
size_t * bytesOut
)

#include <rdmbcdapi.h>

Convert a BCD number with scale to a string.

This function converts a BCD number with scale to a string.

The number of bytes needed for the conversion can be retrieved through

bytesOut by setting result to NULL.
Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[in] scale Scale to use for the output
useExponent [IN] Use exponent in output
[out] result Result of the conversion
[in] inBytes Length of result buffer in bytes
[out] bytesOut A pointer to the number of bytes returned (can be NULL)

rdm_bcdToUInt16()

RDM_RETCODE rdm_bcdToUInt16 ( const RDM_BCD_T * operand,
uint16_t * result
)

#include <rdmbcdapi.h>

Convert a BCD number to an uint16_t.

This function converts a BCD number to an uint16_t.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToUInt32()

RDM_RETCODE rdm_bcdToUInt32 ( const RDM_BCD_T * operand,
uint32_t * result
)

#include <rdmbcdapi.h>

Convert a BCD number to an uint32_t.

This function converts a BCD number to an uint32_t.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToUInt64()

RDM_RETCODE rdm_bcdToUInt64 ( const RDM_BCD_T * operand,
uint64_t * result
)

#include <rdmbcdapi.h>

Convert a BCD number to an uint64_t.

This function converts a BCD number to an uint64_t.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion

rdm_bcdToUInt8()

RDM_RETCODE rdm_bcdToUInt8 ( const RDM_BCD_T * operand,
uint8_t * result
)

#include <rdmbcdapi.h>

Convert a BCD number to an uint8_t.

This function converts a BCD number to an uint8_t.

Return values
sOKAY Success
Parameters
[in] operand Operand to be converted
[out] result Result of the conversion