OCINumberToInt
Purpose : You can call this function to convert an Oracle NUMBER to an integer.
Syntax :
sword OCINumberToInt (
OCIError *err,
const OCINumber *number,
uword rsl_length,
uword rsl_flag,
void *rsl );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | The error handle. |
| number(IN) | The number to be converted. |
| rsl_length(IN) | The size of the rsl parameter. |
| rsl_flag(IN) | The flag that designates the sign of the output. Valid values: OCI_NUMBER_UNSIGNED OCI_NUMBER_SIGNED |
| rsl(OUT) | The pointer to the result space. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberToReal
Purpose : You can call this function to convert an Oracle NUMBER to a real number.
Syntax :
sword OCINumberToReal (
OCIError *err,
const OCINumber *number,
uword rsl_length,
void *rsl );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | The error handle. |
| number(IN) | The number to be converted. |
| rsl_length(IN) | The size of the desired result. The value equals sizeof({ float | double | long double}). |
| rsl(OUT) | The pointer to the result space. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberToText
Purpose : You can call this function to convert an Oracle NUMBER to a string in the specified format.
Syntax :
sword OCINumberToText (
OCIError *err,
const OCINumber *number,
const OraText *fmt,
ub4 fmt_length,
const OraText *nls_params,
ub4 nls_p_length,
ub4 *buf_size,
OraText *buf );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | The error handle. |
| number(IN) | The number to be converted. |
| fmt(IN) | The conversion format. |
| fmt_length(IN) | The length of the format. |
| nls_params(IN) | Default parameters of the session are used if it is a NULL string or ((text *) 0). |
| nls_p_length(IN) | The length of nls_params. |
| buf_size(IN) | The size of the buffer. |
| buf(OUT) | The buffer where the converted string is placed. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberIsInt
Purpose : You can call this function to test whether the OCINumber value is an integer.
Syntax :
sword OCINumberIsInt (
OCIError *err,
const OCINumber *number,
boolean *result );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | The error handle. |
| number(IN) | The number to be tested. |
| result(OUT) | Returns TRUE if the result is an integer, or FALSE if otherwise. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberFromText
Purpose : You can call this function to convert a string to an Oracle NUMBER.
Syntax :
sword OCINumberFromText (
OCIError *err,
const OraText *str,
ub4 str_length,
const OraText *fmt,
ub4 fmt_length,
const OraText *nls_params,
ub4 nls_p_length,
OCINumber *number );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | The error handle. |
| str(IN) | The input string to be converted to an Oracle NUMBER. |
| str_length(IN) | The size of the input string. |
| fmt(IN) | The conversion format. |
| fmt_length(IN) | The length of the format. |
| nls_params(IN) | Default parameters of the session are used if it is a NULL string (""). |
| nls_p_length(IN) | The length of nls_params. |
| number(OUT) | The converted number. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberAbs
Purpose : You can call this function to calculate the absolute value of an Oracle NUMBER.
Syntax :
sword OCINumberAbs ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The input Oracle NUMBER. |
| result (OUT) | The absolute value of the input Oracle NUMBER. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberAdd
Purpose : You can call this function to add one Oracle NUMBER to another Oracle NUMBER.
Syntax :
sword OCINumberAdd ( OCIError *err,
const OCINumber *number1,
const OCINumber *number2,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number1, number2 (IN) | Adds number1 to number2. |
| result (OUT) | The result of adding number1 to number2. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberArcCos
Purpose : You can call this function to obtain the arccosine of an Oracle NUMBER in radians.
Syntax :
sword OCINumberArcCos ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The arccosine parameter. |
| result (OUT) | The arccosine result in radians. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberArcSin
Purpose : You can call this function to obtain the arcsine of an Oracle NUMBER in radians.
Syntax :
sword OCINumberArcSin ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The arcsine parameter. |
| result (OUT) | The arcsine result in radians. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberArcTan
Purpose : You can call this function to obtain the arctangent of an Oracle NUMBER in radians.
Syntax :
sword OCINumberArcTan ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The arctangent parameter. |
| result (OUT) | The arctangent result in radians. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberAssign
Purpose : You can call this function to assign one Oracle NUMBER to another Oracle NUMBER.
Syntax :
sword OCINumberAssign ( OCIError *err,
const OCINumber *from,
OCINumber *to );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| from (IN) | The NUMBER to be assigned. |
| to (OUT) | The target NUMBER to which the number is assigned. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberCeil
Purpose : You can call this function to calculate the ceiling value of an Oracle NUMBER.
Syntax :
sword OCINumberCeil ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The input Oracle NUMBER. |
| result (OUT) | The ceiling value of the input Oracle NUMBER. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberCmp
Purpose : You can call this function to compare one Oracle NUMBER with another Oracle NUMBER.
Syntax :
sword OCINumberCmp ( OCIError *err,
const OCINumber *number1,
const OCINumber *number2,
sword *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number1, number2 (IN) | Compares number1 with number2. |
| result (OUT) | The comparison result. For more information, see the table in the Additional information section. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
Additional information
| Comparison result | Output |
|---|---|
number1<number2 |
negative |
number1=number2 |
0 |
number1>number2 |
positive |
OCINumberCos
Purpose : You can call this function to calculate the cosine of an Oracle NUMBER in radians.
Syntax :
sword OCINumberCos ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The cosine parameter in radians. |
| result (OUT) | The cosine value. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberDec
Purpose : You can call this function to progressively decrement an Oracle NUMBER within a specific range.
Syntax :
sword OCINumberDec ( OCIError *err,
OCINumber *number );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN/OUT) | The positive Oracle NUMBER to be progressively decremented. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberDiv
Purpose : You can call this function to divide one Oracle NUMBER by another Oracle NUMBER.
Syntax :
sword OCINumberDiv ( OCIError *err,
const OCINumber *number1,
const OCINumber *number2,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number1 (IN) | The pointer to the numerator. |
| number2 (IN) | The pointer to the denominator. |
| result (OUT) | The division result. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberExp
Purpose : You can call this function to transfer e as a power series to an Oracle NUMBER.
Syntax :
sword OCINumberExp ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The Oracle NUMBER to which e is transferred. |
| result (OUT) | The result of the exponentiation. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberFloor
Purpose : You can call this function to calculate the rounded-down floor value of an Oracle NUMBER.
Syntax :
sword OCINumberFloor ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The input Oracle NUMBER. |
| result (OUT) | The rounded-down floor value of the Oracle NUMBER. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberFromInt
Purpose : You can call this function to convert an integer to an Oracle NUMBER.
Syntax :
sword OCINumberFromInt ( OCIError *err,
const void *inum,
uword inum_length,
uword inum_s_flag,
OCINumber *number );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| inum (IN) | The pointer to the integer to be converted. |
| inum_length (IN) | The length of the integer. |
| inum_s_flag (IN) | The flag that designates the sign of the integer. Valid values: * OCI_NUMBER_UNSIGNED: indicates an unsigned value. * OCI_NUMBER_SIGNED: indicates a signed value. |
| number (OUT) | The Oracle NUMBER to which the given integer is converted. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberFromReal
Purpose : You can call this function to convert a floating-point real number to an Oracle NUMBER.
Syntax :
sword OCINumberFromReal ( OCIError *err,
const void *rnum,
uword rnum_length,
OCINumber *number );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| rnum (IN) | The pointer to the floating-point number to be converted. |
| rnum_length (IN) | The size of the desired result. The value equals sizeof({ float | double | long double}). |
| number (OUT) | The Oracle NUMBER to which the given floating-point number is converted. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberHypCos
Purpose : You can call this function to calculate the hyperbolic cosine of an Oracle NUMBER.
Syntax :
sword OCINumberHypCos ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The cosine hyperbolic parameter. |
| result (OUT) | The cosine hyperbolic value. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberHypSin
Purpose : You can call this function to calculate the hyperbolic sine of an Oracle NUMBER.
Syntax :
sword OCINumberHypSin ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The hyperbolic sine parameter. |
| result (OUT) | The hyperbolic sine. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberHypTan
Purpose : You can call this function to calculate the hyperbolic tangent of an Oracle NUMBER.
Syntax :
sword OCINumberHypTan ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The hyperbolic tangent parameter. |
| result (OUT) | The hyperbolic tangent. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberInc
Purpose : You can call this function to progressively increment an Oracle NUMBER.
Syntax :
sword OCINumberInc ( OCIError *err,
OCINumber *number );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN/OUT) | The positive Oracle NUMBER to be progressively incremented. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberIsZero
Purpose : You can call this function to test whether a given NUMBER is zero.
Syntax :
sword OCINumberIsZero ( OCIError *err,
const OCINumber *number,
boolean *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The NUMBER to be tested. |
| result (OUT) | Returns TRUE if the Oracle NUMBER is 0, and FALSE if otherwise. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberLn
Purpose : You can call this function to calculate the natural logarithm (with e as the base) of an Oracle NUMBER.
Syntax :
sword OCINumberLn ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The Oracle NUMBER whose logarithm is to be calculated. |
| result (OUT) | The logarithm result. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberLog
Purpose : You can call this function to calculate the logarithm (with any value as the base) of an Oracle NUMBER.
Syntax :
sword OCINumberLog ( OCIError *err,
const OCINumber *base,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| base (IN) | The base of the logarithm. |
| number (IN) | The operand. |
| result (OUT) | The logarithm result. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberMod
Purpose : You can call this function to obtain the modulus (remainder) obtained by dividing one Oracle NUMBER by another.
Syntax :
sword OCINumberMod ( OCIError *err,
const OCINumber *number1,
const OCINumber *number2,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number1 (IN) | The pointer to the numerator. |
| number2 (IN) | The pointer to the denominator. |
| result (OUT) | The remainder of the division. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberMul
Purpose : You can call this function to multiply one Oracle NUMBER by another Oracle NUMBER.
Syntax :
sword OCINumberMul ( OCIError *err,
const OCINumber *number1,
const OCINumber *number2,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number1 (IN) | An Oracle NUMBER to be multiplied. |
| number2 (IN) | An Oracle NUMBER to be multiplied. |
| result (OUT) | The result of the multiplication. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberNeg
Purpose : You can call this function to negate an Oracle NUMBER.
Syntax :
sword OCINumberNeg ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The Oracle NUMBER to be negated. |
| result (OUT) | The negated value of the Oracle NUMBER. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberPrec
Purpose : You can call this function to round an OCINumber to the specified number of decimal places.
Syntax :
sword OCINumberPrec ( OCIError *err,
const OCINumber *number,
eword nDigs,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The number for which the precision is set. |
| nDigs (IN) | The number of decimal places in the result. |
| result (OUT) | The result obtained after the rounding operation. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberRound
Purpose : You can call this function to round an Oracle NUMBER to the specified decimal place.
Syntax :
sword OCINumberRound ( OCIError *err,
const OCINumber *number,
sword decplace,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The Oracle NUMBER to be rounded. |
| decplace (IN) | The target decimal digit to which the Oracle NUMBER is to be rounded. Negative values are allowed. |
| result (OUT) | The result obtained after the rounding operation. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberSetPi
Purpose : You can call this function to set an OCINumber to pi.
Syntax :
void OCINumberSetPi ( OCIError *err,
OCINumber *num );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| num (OUT) | The Oracle NUMBER to be set to pi. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberSetZero
Purpose : You can call this function to initialize an Oracle NUMBER to zero.
Syntax :
void OCINumberSetZero (OCIError *err
OCINumber *num );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. Error check is not performed for this function because it never generates errors. |
| num (OUT) | The Oracle NUMBER to be initialized to zero. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberShift
Purpose : You can call this function to multiply a NUMBER by a power of 10 by moving the decimal point a specified number of decimal places.
Syntax :
sword OCINumberShift ( OCIError *err,
const OCINumber *number,
const sword nDig,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The Oracle NUMBER whose decimal digits are to be moved. |
| nDig (IN) | The number of decimal places that the decimal point is to be moved. |
| result (OUT) | The result of the movement. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberSign
Purpose : You can call this function to obtain the sign of an Oracle NUMBER.
Syntax :
sword OCINumberSign ( OCIError *err,
const OCINumber *number,
sword *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The Oracle NUMBER whose sign is to be returned. |
| result (OUT) | The return value. For more information, see the table in the Additional information section. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
Additional information
| Value | Return result |
|---|---|
number < 0 |
-1 |
number == 0 |
0 |
number > 0 |
1 |
OCINumberSin
Purpose : You can call this function to calculate the sine of an Oracle NUMBER in radians.
Syntax :
sword OCINumberSin ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The sine parameter in radians. |
| result (OUT) | The sine. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberSqrt
Purpose : You can call this function to calculate the square root of an Oracle NUMBER.
Syntax :
sword OCINumberSqrt ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The input Oracle NUMBER. |
| result (OUT) | The square root of the input Oracle NUMBER. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberSub
Purpose : You can call this function to subtract one Oracle NUMBER from another Oracle NUMBER.
Syntax :
sword OCINumberSub ( OCIError *err,
const OCINumber *number1,
const OCINumber *number2,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number1, number2 (IN) | Subtracts number2 from number1. |
| result (OUT) | The result of the subtraction. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberTan
Purpose : You can call this function to calculate the tangent of an Oracle NUMBER in radians.
Syntax :
sword OCINumberTan ( OCIError *err,
const OCINumber *number,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The tangent parameter in radians. |
| result (OUT) | The tangent. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberToRealArray
Purpose : You can call this function to convert a NUMBER array into a real-number array.
Syntax :
sword OCINumberToRealArray ( OCIError *err,
const OCINumber **number,
uword elems,
uword rsl_length,
void *rsl );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The pointer to the NUMBER array to be converted. |
| elems (IN) | The maximum number of NUMBER pointers. |
| rsl_length (IN) | The size of the desired result. The value equals sizeof({ float | double | long double}). |
| rsl (OUT) | The pointer to the space array that stores the result. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.
OCINumberTrunc
Purpose : You can call this function to truncate an Oracle NUMBER at the specified decimal place.
Syntax :
sword OCINumberTrunc ( OCIError *err,
const OCINumber *number,
sword decplace,
OCINumber *result );
Parameters :
| Parameter | Description |
|---|---|
| err (IN/OUT) | The error handle. If any error occurs, it is recorded in err, and the function returns OCI_ERROR. You can call OCIErrorGet to obtain the diagnostic information. |
| number (IN) | The input Oracle NUMBER. |
| decplace (IN) | The number of decimal places to be retained on the right of the decimal point after truncation. Negative values are allowed. |
| result (OUT) | The result of the truncation. |
Return value : OCI_SUCCESS is returned if the function call succeeded, and OCI_ERROR is returned if the function call failed.