Standard C Library Functions decimal_to_floating(3C)
NAME
decimal_to_floating, decimal_to_single, decimal_to_double,
decimal_to_extended, decimal_to_quadruple - convert decimal
record to floating-point value
SYNOPSIS
#include
void decimal_to_single(single *px, decimal_mode *pm,
decimal_record *pd, fp_exception_field_type *ps);
void decimal_to_double(double *px, decimal_mode *pm,
decimal_record *pd, fp_exception_field_type *ps);
void decimal_to_extended(extended *px, decimal_mode *pm,
decimal_record *pd, fp_exception_field_type *ps);
void decimal_to_quadruple(quadruple *px, decimal_mode *pm,
decimal_record *pd, fp_exception_field_type *ps);
DESCRIPTION
These functions convert the decimal record *pd to afloating-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 fp_zero, fp_infinity, fp_quiet, or
fp_signaling, *px is set to zero, infinity, a quiet NaN, or
a signaling NaN, respectively, with the sign indicated bypd->sign. All other fields in *pd are ignored.
When pd->fpclass is fp_normal or fp_subnormal, pd->ds must
contain a null-terminated string of one or more ASCII 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 decimal_to_floating(3C)
The converted value is rounded according to the roundingdirection specified in pm->rd. pm->df and pm->ndigits are
not used. On exit, *ps contains a bitwise OR of flags corresponding toany floating-point exceptions that occurred. The only possi-
ble exceptions are underflow, overflow, and inexact. If nofloating-point exceptions occurred, *ps is set to zero.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| MT-Level | MT-Safe |
|_____________________________|_____________________________|
SEE ALSO
scanf(3C), string_to_decimal(3C), strtod(3C), attributes(5)
SunOS 5.11 Last change: 1 Oct 2001 2