Research V4 development
[unix-history] / man / man3 / ecvt.3
CommitLineData
c2c9b200
KT
1.th ECVT III 4/30/73
2.sh NAME
3ecvt \*- output conversion
4.sh SYNOPSIS
5.ft B
6jsr pc,ecvt
7.s3
8jsr pc,fcvt
9.s3
10char *ecvt(value, ndigit, decpt, sign)
11.br
12double value;
13.br
14int ndigit, *decpt, *sign;
15.s3
16char *fcvt(value, ndigit, decpt, sign)
17.br
18.li
19...
20.ft R
21.sh DESCRIPTION
22.it Ecvt
23is called with a floating point number in fr0.
24.s3
25On exit, the number has been converted into a
26string of ascii digits in a buffer pointed to by r0.
27The number of digits produced is controlled
28by a global variable \fI\*_ndigits\fR.
29.s3
30Moreover, the position of the decimal point is
31contained in r2: r2=0 means the d.p. is at the
32left hand end of the string of digits;
33r2>0 means the d.p. is within or to the right
34of the string.
35.s3
36The sign of the number is indicated by r1 (0 for +; 1 for \*-).
37.s3
38The low order digit has suffered decimal rounding
39(i. e. may have been carried into).
40.s3
41From C,
42the
43.it value
44is converted and a pointer to a null-terminated
45string of \fIndigit\fR digits is returned.
46The position of the decimal point is stored indirectly
47through \fIdecpt\fR (negative means to the left of the
48returned digits).
49If the sign of the result is negative,
50the word pointed to by \fIsign\fR is non-zero, otherwise
51it is zero.
52.s3
53\fIFcvt\fR is identical to \fIecvt\fR, except that the correct digit
54has had decimal rounding for F-style output of the number
55of digits specified by \fI\(*_ndigits\fR.
56.sh "SEE ALSO"
57printf(III)
58.sh BUGS