decimal_to_floating man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]


       decimal_to_floating,    decimal_to_single,   decimal_to_double,	 deci‐
       mal_to_extended,	 decimal_to_quadruple  -  convert  decimal  record  to
       floating-point value

       #include <floatingpoint.h>

       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);

       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  fp_zero, fp_infinity, fp_quiet, or fp_signaling,
       *px is set to zero, infinity, a quiet NaN, or a signaling NaN,  respec‐
       tively,	with  the  sign indicated by pd->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

       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 float‐
       ing-point exceptions that occurred. The only  possible  exceptions  are
       underflow,  overflow,  and  inexact.   If  no floating-point exceptions
       occurred, *ps is set to zero.

       See attributes(5) for descriptions of the following attributes:

       │MT-Level       │ MT-Safe	 │

       scanf(3C), string_to_decimal(3C), strtod(3C), attributes(5)

				  Oct 1, 2001	       DECIMAL_TO_FLOATING(3C)

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net