Standard C Library Functions decimaltofloating(3C)
NAME
decimaltofloating, decimaltosingle, decimaltodouble,
decimaltoextended, decimaltoquadruple - convert decimal
record to floating-point value
SYNOPSIS
#include
void decimaltosingle(single *px, decimalmode *pm,
decimalrecord *pd, fpexceptionfieldtype *ps);
void decimaltodouble(double *px, decimalmode *pm,
decimalrecord *pd, fpexceptionfieldtype *ps);
void decimaltoextended(extended *px, decimalmode *pm,
decimalrecord *pd, fpexceptionfieldtype *ps);
void decimaltoquadruple(quadruple *px, decimalmode *pm,
decimalrecord *pd, fpexceptionfieldtype *ps);
DESCRIPTION
These functions convert the decimal record *pd to a
floating-point value *px observing the rounding direction
specified in *pm and setting *ps to reflect any floating-
point exceptions that occur.
When pd->fpclass is fpzero, fpinfinity, fpquiet, or
fpsignaling, *px is set to zero, infinity, a quiet NaN, or
a signaling NaN, respectively, with the sign indicated by
pd->sign. All other fields in *pd are ignored.
When pd->fpclass is fpnormal or fpsubnormal, pd->ds must
contain a null-terminated string of one or more ASCI digits
representing a non-zero integer m, and pd->ndigits must be
equal to the length of this string. Then *px is set to a
correctly rounded approximation to
-1**(pd->sign) * m * 10**(pd->exponent)
pd->more can be set to a non-zero value to indicate that
insignificant trailing digits were omitted from pd->ds. In
this case, m is replaced by m ] delta in the expression
above, where delta is some tiny positive fraction.
SunOS 5.11 Last change: 1 Oct 2001 1
Standard C Library Functions decimaltofloating(3C)
The converted value is rounded according to the rounding
direction specified in pm->rd. pm->df and pm->ndigits are
not used.
On exit, *ps contains a bitwise OR of flags corresponding to
any floating-point exceptions that occurred. The only possi-
ble exceptions are underflow, overflow, and inexact. If no
floating-point exceptions occurred, *ps is set to zero.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
MT-Level MT-Safe
SEE ALSO
scanf(3C), stringtodecimal(3C), strtod(3C), attributes(5)
SunOS 5.11 Last change: 1 Oct 2001 2
|