SQL/MX 3.2 Programming Manual for C and COBOL (H06.25+, J06.14+)

Host Variables in C/C++ Programs
HP NonStop SQL/MX Release 3.2 Programming Manual for C and COBOL663854-002
3-22
Numeric Data
If the comparison is successful, this function returns 0, otherwise, the function returns -
1.
Conversion Functions
You can convert a BigNum value to an ASCII character string or convert an ASCII
character string to a BigNum value, or find the number of bytes required for a BigNum
value, if given a precision, using the conversion functions.
SQL_BignumFromStr
The SQL_BignumFromStr function converts an ASCII string to a BigNum value:
int SQL_BignumFromStr( BignumExt result, UInt16 resultLen,
char const *str)
This function converts the str operand to a BigNum value and stores the value in the
result parameter.
If the conversion is successful, this function returns 0. Otherwise, the function returns
an EXE_NUMERIC_OVERFLOW error.
SQL_BignumToStr
The SQL_BignumToStr function converts a BigNum value to an ASCII string
representation.
int SQL_BignumToStr( char * result, UInt16 resultLen,
BignumExt bnValue, UInt16 bnValueLen)
Converts the BigNum bnValue into its ASCII string representation in the result.
If the conversion is successful, this function returns 0. Otherwise, the function returns
an EXE_STRING_OVERFLOW error.
SQL_BignumSize
The SQL_BignumSize converts a precision to the required number of bytes to store a
BigNum value:
int SQL_BignumSize( UInt16 precision)
This function returns the number of bytes that is required to hold a BigNum value for
the given BigNum precision.
Arithmetic Functions
You can perform arithmetic operations on BigNum values and retrieve the sign of a
BigNum value using the arithmetic functions.
SQL_BignumAdd
The SQL_BignumAdd function adds two BigNum values: