version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
ECVT |
|
|
2 |
!!!ECVT |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
NOTES |
|
|
8 |
CONFORMING TO |
|
|
9 |
SEE ALSO |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
ecvt, fcvt - convert a floating-point number to a string. |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__#include __ |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
__char *ecvt(double__ ''number''__, int__ |
|
|
22 |
''ndigits''__, int *__''decpt''__, int |
|
|
23 |
*__''sign''__);__ |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
__char *fcvt(double__ ''number''__, int__ |
|
|
27 |
''ndigits''__, int *__''decpt''__, int |
|
|
28 |
*__''sign''__);__ |
|
|
29 |
!!DESCRIPTION |
|
|
30 |
|
|
|
31 |
|
|
|
32 |
The __ecvt()__ function converts ''number'' to a |
|
|
33 |
null-terminated string of ''ndigits'' digits (where |
|
|
34 |
''ndigits'' is reduced to an system-specific limit |
|
|
35 |
determined by the precision of a double), and returns a |
|
|
36 |
pointer to the string. The high-order digit is nonzero, |
|
|
37 |
unless ''number'' is zero. The low order digit is |
|
|
38 |
rounded. The string itself does not contain a decimal point; |
|
|
39 |
however, the position of the decimal point relative to the |
|
|
40 |
start of the string is stored in *''decpt''. A negative |
|
|
41 |
value for *''decpt'' means that the decimal point is to |
|
|
42 |
the left of the start of the string. If the sign of |
|
|
43 |
''number'' is negative, *''sign'' is set to a non-zero |
|
|
44 |
value, otherwise it's set to 0. If ''number'' is zero, it |
|
|
45 |
is unspecified whether *''decpt'' is 0 or 1. |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
The __fcvt()__ function is identical to __ecvt()__, |
|
|
49 |
except that ''ndigits'' specifies the number of digits |
|
|
50 |
after the decimal point. |
|
|
51 |
!!RETURN VALUE |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
Both the __ecvt()__ and __fcvt()__ functions return a |
|
|
55 |
pointer to a static string containing the ASCII |
|
|
56 |
representation of ''number''. The static string is |
|
|
57 |
overwritten by each call to __ecvt()__ or |
|
|
58 |
__fcvt()__. |
|
|
59 |
!!NOTES |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
These functions are obsolete. Instead, ''sprintf''() is |
|
|
63 |
recommended. Linux libc4 and libc5 specified the type of |
|
|
64 |
''ndigits'' as __size_t__. Not all locales use a point |
|
|
65 |
as the radix character (`decimal point'). |
|
|
66 |
!!CONFORMING TO |
|
|
67 |
|
|
|
68 |
|
|
|
69 |
SysVR2, XPG2 |
|
|
70 |
!!SEE ALSO |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
gcvt(3), setlocale(3), |
|
|
74 |
sprintf(3) |
|
|
75 |
---- |