BSD 3 development
[unix-history] / usr / man / man3 / ecvt.3
CommitLineData
e6817382
BJ
1.TH ECVT 3
2.SH NAME
3ecvt, fcvt, gcvt \- output conversion
4.SH SYNOPSIS
5.B char *ecvt(value, ndigit, decpt, sign)
6.br
7.B double value;
8.br
9.B int ndigit, *decpt, *sign;
10.PP
11.B char *fcvt(value, ndigit, decpt, sign)
12.br
13.B double value;
14.br
15.B int ndigit, *decpt, *sign;
16.PP
17.B char *gcvt(value, ndigit, buf)
18.br
19.B double value;
20.br
21.B char *buf;
22.SH DESCRIPTION
23.I Ecvt
24converts the
25.I value
26to a null-terminated string of
27.I ndigit
28ASCII digits
29and returns a pointer thereto.
30The position of the decimal point relative to the
31beginning of the string is stored indirectly
32through
33.IR decpt ""
34(negative means to the left of the
35returned digits).
36If the sign of the result is negative,
37the word pointed to by
38.IR sign ""
39is non-zero, otherwise
40it is zero.
41The low-order digit is rounded.
42.PP
43.IR Fcvt " is identical to " "ecvt\fR, except that the correct digit"
44has been rounded for Fortran F-format output of the number
45of digits specified by
46.IR \(*_ndigits .
47.PP
48.I Gcvt
49converts the
50.I value
51to a null-terminated ASCII string in
52.I buf
53and returns a pointer to
54.I buf.
55It attempts to produce
56.I ndigit
57significant digits in Fortran F format if
58possible, otherwise E format, ready for
59printing.
60Trailing zeros may be suppressed.
61.SH "SEE ALSO"
62printf(3)
63.SH BUGS
64The return values point to static data
65whose content is overwritten by each call.