Binary-coded decimal (BCD) API
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_bcdAddDouble (const RDM_BCD_T *operand1, double 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_bcdCos (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the cosine of a number. More...
RDM_RETCODE rdm_bcdCot (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the cotangent of a number. More...
RDM_RETCODE rdm_bcdCsc (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the cosecant of a 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)
Divide two numbers. More...
RDM_RETCODE rdm_bcdDivByDouble (const RDM_BCD_T *operand1, double operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers. More...
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_bcdDivDouble (double operand1, const RDM_BCD_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_bcdExp (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the exponent of a number. 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...
RDM_BOOL_T rdm_bcdIsZero (const RDM_BCD_T *argument)
Is a number zero. More...
RDM_RETCODE rdm_bcdLog (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the natual logarithm of a number. More...
RDM_RETCODE rdm_bcdLog10 (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the logarithm base 10 of a number. 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_bcdMultDouble (const RDM_BCD_T *operand1, double 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_bcdPi (RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *pi)
Pi. More...
RDM_RETCODE rdm_bcdPow (const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number. More...
RDM_RETCODE rdm_bcdPowInt32 (const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number. More...
RDM_RETCODE rdm_bcdPowInt64 (const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number. More...
RDM_RETCODE rdm_bcdPowUInt32 (const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number. More...
RDM_RETCODE rdm_bcdPowUInt64 (const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number. 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...
RDM_RETCODE rdm_bcdSec (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the secant of a number. More...
int16_t rdm_bcdSign (const RDM_BCD_T *argument)
Get the sign of a number. More...
RDM_RETCODE rdm_bcdSin (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the sine of a number. More...
RDM_RETCODE rdm_bcdSqrt (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the square root 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_bcdSubDouble (const RDM_BCD_T *operand1, double operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers. More...
RDM_RETCODE rdm_bcdSubFromDouble (double 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_bcdTan (const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the tangent of a number. 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, RDM_BOOL_T 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, RDM_BOOL_T 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 RDM BCD datatype API. The functions here are located in RDM 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_bcdAddDouble()

RDM_RETCODE rdm_bcdAddDouble ( const RDM_BCD_T * operand1,
double 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_bcdCos()

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

#include <rdmbcdapi.h>

Take the cosine of a number.

This function takes the cosine 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_bcdCot()

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

#include <rdmbcdapi.h>

Take the cotangent of a number.

This function takes the cotangent 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_bcdCsc()

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

#include <rdmbcdapi.h>

Take the cosecant of a number.

This function takes the cosecant 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_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>

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_bcdDivByDouble()

RDM_RETCODE rdm_bcdDivByDouble ( const RDM_BCD_T * operand1,
double 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_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_bcdDivDouble()

RDM_RETCODE rdm_bcdDivDouble ( double 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_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_bcdExp()

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

#include <rdmbcdapi.h>

Take the exponent of a number.

This function takes the exponent 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_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()

RDM_BOOL_T 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
RDM_BOOL_T
Return values
RDM_TRUE The number is zero
RDM_FALSE The number is not zero
Parameters
[in] argument The argument that is checked

rdm_bcdLog()

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

#include <rdmbcdapi.h>

Take the natual logarithm of a number.

This function takes the natual logarithm 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_bcdLog10()

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

#include <rdmbcdapi.h>

Take the logarithm base 10 of a number.

This function takes the logarithm base 10 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_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_bcdMultDouble()

RDM_RETCODE rdm_bcdMultDouble ( const RDM_BCD_T * operand1,
double 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_bcdPi()

RDM_RETCODE rdm_bcdPi ( RDM_BCD_ROUNDING_MODE rounding_mode,
RDM_BCD_T * pi
)

#include <rdmbcdapi.h>

Pi.

This function returns Pi as a BCD number.

Return values
sOKAY Success
Parameters
[in] rounding_mode rounding mode
pi *< [out] Pi result value

rdm_bcdPow()

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

#include <rdmbcdapi.h>

Take the power of a number.

This function takes the power of a BCD number.

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_bcdPowInt32()

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

#include <rdmbcdapi.h>

Take the power of a number.

This function takes the power of a BCD number.

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_bcdPowInt64()

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

#include <rdmbcdapi.h>

Take the power of a number.

This function takes the power of a BCD number.

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_bcdPowUInt32()

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

#include <rdmbcdapi.h>

Take the power of a number.

This function takes the power of a BCD number.

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_bcdPowUInt64()

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

#include <rdmbcdapi.h>

Take the power of a number.

This function takes the power of a BCD number.

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_bcdSec()

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

#include <rdmbcdapi.h>

Take the secant of a number.

This function takes the secant 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_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_bcdSin()

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

#include <rdmbcdapi.h>

Take the sine of a number.

This function takes the sine 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_bcdSqrt()

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

#include <rdmbcdapi.h>

Take the square root of a number.

This function takes the square root of a BCD.

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

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_bcdSubDouble()

RDM_RETCODE rdm_bcdSubDouble ( const RDM_BCD_T * operand1,
double 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_bcdSubFromDouble()

RDM_RETCODE rdm_bcdSubFromDouble ( double 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_bcdTan()

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

#include <rdmbcdapi.h>

Take the tangent of a number.

This function takes the tangent 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_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,
RDM_BOOL_T 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,
RDM_BOOL_T 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