#include <stdlib.h>
char *fcvt(double value, int ndigit,
int *decpt, int *sign);
The fcvt() function converts a floating-point value to
a null-terminated string of ndigit digits
(where ndigit specifies the number of digits
desired after the radix point (decimal point)) and returns a pointer to the
string. The total number of digits in the result string is
restricted to an unspecified limit as determined by the precision
of a double.
The high-order digit is non-zero, unless the value is 0. The low-order
digit is rounded. The position of the radix character relative to
the beginning of the string is stored in the integer pointed to
by decpt (negative means to the left of the returned
digits). If value is zero, it is unspecified whether the integer
pointed to by decpt would be 0 or 1. The radix character is not
included in the returned string. If the sign of the result is
negative, the integer pointed to by sign is non-zero,
otherwise it is 0.
If the converted value is out of range or is not representable,
the contents of the returned string are unspecified.
- value
-
Is a floating-point number to be converted.
- ndigit
-
Is the number of digits after decimal point.
- decpt
-
Is the return pointer to the decimal point position.
- sign
-
Is the return pointer to the sign indicator.
The fcvt() function
always returns a pointer to a null-terminated string of digits.
UNIX 98.
Unsafe.
None.
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
- Functions:
- ecvt(), gcvt()
MKS Toolkit 9.3 Documentation Build 6.