BIGINT functions for C

The following BIGINT functionality is available only to users of IBM® Informix® ESQL/C. To use these functions, ESQL/C users must manually link their C code to the ESQL/C libraries.

The BIGINT data type is a machine-independent method for representing numbers in the range of -263-1 to 263-1. ESQL/C provides routines that facilitate the conversion from the BIGINT data type to other data types in the C language.

The BIGINT data type is internally represented with the ifx_int8_t structure. Information about the structure can be found in the header file int8.h, which is included in the ESQL/C product. Include this file in all C source files that use any of the BIGINT functions.

All operations on int8 type numbers must be performed using the following ESQL/C library functions for the int8 data type. Any other operations, modifications, or analyses can produce unpredictable results. The ESQL/C library provides the following functions that allow you to manipulate int8 numbers and convert int8 type numbers to and from other data types.

Function Name Description
ifx_int8add( ) Adds two BIGINT type values
ifx_int8cmp( ) Compares two BIGINT type numbers
ifx_int8copy( ) Copies an ifx_int8_t structure
ifx_int8cvasc( ) Converts a C char type value to a BIGINT type number
ifx_int8cvdbl( ) Converts a C double type number to a BIGINT type number
ifx_int8cvdec( ) Converts a decimal type value into a BIGINT type value
ifx_int8cvflt( ) Converts a C float type value into a BIGINT type value
ifx_int8cvint( ) Converts a C int type number into a BIGINT type number
ifx_int8cvlong( ) Converts a C long (int on 64 bit machine) type value to a BIGINT type value
ifx_int8cvlong_long( ) Converts a C long long type (8-byte value, long long in 32 bit and long in 64 bit) value into a BIGINT type value
ifx_int8div( ) Divides two BIGINT numbers
ifx_int8mul( ) Multiples two BIGINT numbers
ifx_int8sub( ) Subtracts two BIGINT numbers
ifx_int8toasc( ) Converts a BIGINT type value to a C char type value
ifx_int8todbl( ) Converts a BIGINT type value to a C double type value
ifx_int8todec( ) Converts a BIGINT type number into a decimal type number
ifx_int8toflt( ) Converts a BIGINT type number into a C float type number
ifx_int8toint( ) Converts a BIGINT type value to a C int type value
ifx_int8tolong( ) Converts a BIGINT type value to a C long (int on 64 bit machine) type value
ifx_int8tolong_long( ) Converts a C long long (long on 64 bit machine) type to a BIGINT type value

For more information about the individual functions, see the following: IBM Informix ESQL/C Programmer's Manual.


Feedback