Commit | Line | Data |
---|---|---|
225007cc TL |
1 | .TH ECVT 3 |
2 | .SH NAME | |
3 | ecvt, 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 | |
24 | converts the | |
25 | .I value | |
26 | to a null-terminated string of | |
27 | .I ndigit | |
28 | ASCII digits | |
29 | and returns a pointer thereto. | |
30 | The position of the decimal point relative to the | |
31 | beginning of the string is stored indirectly | |
32 | through | |
33 | .IR decpt "" | |
34 | (negative means to the left of the | |
35 | returned digits). | |
36 | If the sign of the result is negative, | |
37 | the word pointed to by | |
38 | .IR sign "" | |
39 | is non-zero, otherwise | |
40 | it is zero. | |
41 | The low-order digit is rounded. | |
42 | .PP | |
43 | .IR Fcvt " is identical to " "ecvt\fR, except that the correct digit" | |
44 | has been rounded for Fortran F-format output of the number | |
45 | of digits specified by | |
46 | .IR \(*_ndigits . | |
47 | .PP | |
48 | .I Gcvt | |
49 | converts the | |
50 | .I value | |
51 | to a null-terminated ASCII string in | |
52 | .I buf | |
53 | and returns a pointer to | |
54 | .I buf. | |
55 | It attempts to produce | |
56 | .I ndigit | |
57 | significant digits in Fortran F format if | |
58 | possible, otherwise E format, ready for | |
59 | printing. | |
60 | Trailing zeros may be suppressed. | |
61 | .SH "SEE ALSO" | |
62 | printf(3) | |
63 | .SH BUGS | |
64 | The return values point to static data | |
65 | whose content is overwritten by each call. |