Download C-ISAM Programmer`s Manual

Transcript
DECCVDBL
DECCVDBL
Overview
Use deccvdbl to convert a C type double into a DECIMALTYPE number.
Syntax
deccvdbl(dbl, np)
double dbl;
dec_t *np;
Explanation
dbl
is a double-precision floating-point number.
np
is a pointer to a dec_t structure that receives the result of the
conversion.
Return Codes
-1
0
Error; iserrno contains the error code
Successful
Example
#include <decimal.h>
dec_t mydecimal;
double mydouble;
/* Set the decimal structure
* mydecimal to 3.14159.
*/
deccvdbl(3.14159, &mydecimal);
mydouble = 123456.78;
/* Convert the variable mydouble into
* a DECIMALTYPE number held in
* mydecimal.
*/
deccvdbl(mydouble, &mydecimal);
8-100
Call Formats and Descriptions