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