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