1ECVT_R(3) Linux Programmer's Manual ECVT_R(3)
2
3
4
6 ecvt_r, fcvt_r, qecvt_r, qfcvt_r - convert a floating-point number to a
7 string
8
10 #include <stdlib.h>
11
12 int ecvt_r(double number, int ndigits, int *decpt,
13 int *sign, char *buf, size_t len);
14
15 int fcvt_r(double number, int ndigits, int *decpt,
16 int *sign, char *buf, size_t len);
17
18 int qecvt_r(long double number, int ndigits, int *decpt,
19 int *sign, char *buf, size_t len);
20
21 int qfcvt_r(long double number, int ndigits, int *decpt,
22 int *sign, char *buf, size_t len);
23
24 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
25
26 ecvt_r(), fcvt_r(), qecvt_r(), qfcvt_r():
27 /* Glibc since 2.19: */ _DEFAULT_SOURCE
28 || /* Glibc versions <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
29
31 The functions ecvt_r(), fcvt_r(), qecvt_r(), and qfcvt_r() are identi‐
32 cal to ecvt(3), fcvt(3), qecvt(3), and qfcvt(3), respectively, except
33 that they do not return their result in a static buffer, but instead
34 use the supplied buf of size len. See ecvt(3) and qecvt(3).
35
37 These functions return 0 on success, and -1 otherwise.
38
40 For an explanation of the terms used in this section, see
41 attributes(7).
42
43 ┌─────────────────────┬───────────────┬─────────┐
44 │Interface │ Attribute │ Value │
45 ├─────────────────────┼───────────────┼─────────┤
46 │ecvt_r(), fcvt_r(), │ Thread safety │ MT-Safe │
47 │qecvt_r(), qfcvt_r() │ │ │
48 └─────────────────────┴───────────────┴─────────┘
50 These functions are GNU extensions.
51
53 These functions are obsolete. Instead, sprintf(3) is recommended.
54
56 ecvt(3), qecvt(3), sprintf(3)
57
59 This page is part of release 5.04 of the Linux man-pages project. A
60 description of the project, information about reporting bugs, and the
61 latest version of this page, can be found at
62 https://www.kernel.org/doc/man-pages/.
63
64
65
66GNU 2016-03-15 ECVT_R(3)