ECVT(3C) — Silicon Graphics
NAME
ecvt, fcvt, gcvt − convert single precision floating-point number to string
_d_ecvt, _d_fcvt, _d_gcvt − convert double precision floating point number to string
SYNOPSIS
char ∗ecvt (value, ndigit, decpt, sign)
float value;
int ndigit, ∗decpt, ∗sign;
char ∗_d_ecvt (value, ndigit, decpt, sign)
long float value;
int ndigit, ∗decpt, ∗sign;
char ∗fcvt (value, ndigit, decpt, sign)
float value;
int ndigit, ∗decpt, ∗sign;
char ∗_d_fcvt (value, ndigit, decpt, sign)
long float value;
int ndigit, ∗decpt, ∗sign;
char ∗gcvt (value, ndigit, buf)
float value;
char ∗buf;
char ∗_d_gcvt (value, ndigit, buf)
long float value;
char ∗buf;
DESCRIPTION
Ecvt converts value to a null-terminated string of ndigit digits, returning a pointer to the string. The low-order digit is rounded. The position of the decimal point relative to the beginning of the string is stored indirectly through decpt (negative means to the left of the returned digits). The decimal point is not included in the returned string. If the sign of the result is negative, the word pointed to by sign is non-zero, otherwise it is zero.
Fcvt is identical to ecvt(_lecvt), except that the correct digit has been rounded for Fortran F-format output of the number of digits specified by ndigit.
Gcvt converts the value to a null-terminated string in the array pointed to by buf and returns buf. It attempts to produce ndigit significant digits in Fortran F-format if possible, otherwise E-format, ready for printing. A minus sign, if there is one, or a decimal point will be included as part of the returned string. Trailing zeros are suppressed.
The long float versions _d_ecvt, _d_fcvt, and _d_gcvt function the same as the standard entry points, returning the type long float.
DIAGNOSTICS
The functions use standard floating point, and may cause exceptions due to overflow or underflow. In addition, attempting to convert a NaN or infinity will cause an exception through the standard handler fpsignal, with the operation CONVERT and the type CONVERT_INFINITY (for infinity) or INVALID_OP_A (for NaN).
SEE ALSO
BUGS
The return values point to static data whose content is overwritten by each call.
Version 2.3 — July 04, 1985