move to compatibility libary
[unix-history] / usr / src / lib / libcompat / 4.3 / ecvt.3
CommitLineData
f021cba0 1.\" @(#)ecvt.3 6.3 (Berkeley) %G%
7a02e288 2.\"
0186153d 3.TH ECVT 3 ""
7a02e288
KM
4.AT 3
5.SH NAME
6ecvt, 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
e3800388 22.ft B
f021cba0
KB
23These interfaces are obsoleted by printf(3).
24.br
25They are available from the compatibility library, libcompat.
e3800388
KB
26.ft R
27.PP
7a02e288
KM
28.I Ecvt
29converts the
30.I value
31to a null-terminated string of
32.I ndigit
26c5620c 33ASCII digits and returns a pointer thereto.
7a02e288 34The position of the decimal point relative to the
26c5620c 35beginning of the string is stored indirectly through
7a02e288 36.IR decpt ""
26c5620c
KM
37(negative means to the left of the returned digits).
38If the sign of the result is negative, the word pointed to by
7a02e288 39.IR sign ""
26c5620c 40is non-zero, otherwise it is zero. The low-order digit is rounded.
7a02e288
KM
41.PP
42.IR Fcvt " is identical to " "ecvt\fR, except that the correct digit"
43has been rounded for Fortran F-format output of the number
44of digits specified by
45.IR \(*_ndigits .
46.PP
47.I Gcvt
48converts the
49.I value
50to a null-terminated ASCII string in
51.I buf
52and returns a pointer to
53.I buf.
54It attempts to produce
55.I ndigit
26c5620c
KM
56significant digits in Fortran F format if possible, otherwise E format,
57ready for printing. Trailing zeros may be suppressed.
7a02e288
KM
58.SH "SEE ALSO"
59printf(3)
60.SH BUGS
61The return values point to static data
62whose content is overwritten by each call.