SQL/MX 3.2.1 Programming Manual for C and COBOL (H06.26+, J06.15+)
Host Variables in C/C++ Programs
HP NonStop SQL/MX Release 3.2.1 Programming Manual for C and COBOL—663854-005
3-26
Numeric Data
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:
int SQL_BignumAdd( BignumExt result, BignumExt operand1,
BignumExt operand2, UInt16 len )
The result is the sum of operand1 and operand2. Both the operands must have
the same length and scale.
If the operation is successful, this function returns 0. Otherwise, the function returns an
EXE_NUMERIC_OVERFLOW error.
SQL_BignumSub
The SQL_BignumSub function subtracts a BigNum value from the other:
int SQL_BignumSub( BignumExt result, BignumExt operand1,
BignumExt operand2, UInt16 len )
The result is the difference between operand1 and operand2. operand2 is
subtracted from operand1. Both operands must have the same length and scale.
If the operation is successful, this function returns 0. Otherwise the function returns an
EXE_NUMERIC_OVERFLOW error.
SQL_BignumMul
The SQL_BignumMul function multiplies two BigNum values:










