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 COBOL—663854-002
3-23
Numeric Data
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:
int SQL_BignumMul( BignumExt result, Uint16 resultLen,
BignumExt operand1, Uint16 operand1Len, BignumExt operand2,
UInt16 operand2Len)
The result is the product of operand1 and operand2.
If the operation is successful, this function returns 0. Otherwise, the function returns an
EXE_NUMERIC_OVERFLOW error.
SQL_BignumDiv
The SQL_BignumDiv function divides two BigNum values.
int SQL_BignumDiv( BignumExt result, UInt16 resultLen,
BignumExt operand1, UInt16 operand1Len, BignumExt operand2,
UInt16 operand2Len)
The result is the quotient of dividing operand1 by operand2.
The function returns:
0, if the division does not produce a remainder
1, if the division produces a remainder
EXE_DIVISION_BY_ZERO, if the operand2 value is zero.
EXE_NUMERIC_OVERFLOW error, if the division is not successful










