AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox

01.01.2013 Views

� --- ·

ECVT (3C) ECVT (3C) NAME ecvt, fcvt, gcvt - convert floating-point number to string SYNOPSIS char •ecvt (value, ndigit, decpt, sign) double value; int ndigit, •decpt, •sign; char •fcvt (value, ndigit, decpt, sign) double value; int ndigit, •decpt, •sign; char •gcvt (value, ndigit, buf) double value; char •buf; DESCRIPTION Ecvt converts value to a null-terminated string of ndigit digits and returns a pointer thereto. 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, 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 Eformat, 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. SEE ALSO printf(3S). BUGS The return values point to static data whose content is overwrit­ ten by each call. - 1 -

ECVT (3C) ECVT (3C)<br />

NAME<br />

ecvt, fcvt, gcvt - convert floating-point number to string<br />

SYNOPSIS<br />

char •ecvt (value, ndigit, decpt, sign)<br />

double value;<br />

int ndigit, •decpt, •sign;<br />

char •fcvt (value, ndigit, decpt, sign)<br />

double value;<br />

int ndigit, •decpt, •sign;<br />

char •gcvt (value, ndigit, buf)<br />

double value;<br />

char •buf;<br />

DESCRIPTION<br />

Ecvt converts value to a null-terminated string of ndigit digits<br />

and returns a pointer thereto. The low-order digit is rounded.<br />

The position of the decimal point relative to the beginning of the<br />

string is stored indirectly through decpt (negative means to the<br />

left of the returned digits). The decimal point is not included in<br />

the returned string. If the sign of the result is negative, the word<br />

pointed to by sign is non-zero, otherwise it is zero.<br />

Fcvt is identical to ecvt, except that the correct digit has been<br />

rounded for FORTRAN F-format output of the number of digits<br />

specified by ndigit .<br />

Gcvt converts the value to a null-terminated string in the array<br />

pointed to by buf and returns buf. It attempts to produce ndigit<br />

significant digits in FORTRAN F-format if possible, otherwise Eformat,<br />

ready for printing. A minus sign, if there is one, or a<br />

decimal point will be included as part of the returned string.<br />

Trailing zeros are suppressed.<br />

SEE ALSO<br />

printf(3S).<br />

BUGS<br />

The return values point to static data whose content is overwrit­<br />

ten by each call.<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!