1ecvt_r(3) Library Functions 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 Standard C library (libc, -lc)
11
13 #include <stdlib.h>
14
15 [[deprecated]] int ecvt_r(double number, int ndigits,
16 int *restrict decpt, int *restrict sign,
17 char *restrict buf, size_t len);
18 [[deprecated]] int fcvt_r(double number, int ndigits,
19 int *restrict decpt, int *restrict sign,
20 char *restrict buf, size_t len);
21
22 [[deprecated]] int qecvt_r(long double number, int ndigits,
23 int *restrict decpt, int *restrict sign,
24 char *restrict buf, size_t len);
25 [[deprecated]] int qfcvt_r(long double number, int ndigits,
26 int *restrict decpt, int *restrict sign,
27 char *restrict buf, size_t len);
28
29 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
30
31 ecvt_r(), fcvt_r(), qecvt_r(), qfcvt_r():
32 /* glibc >= 2.19: */ _DEFAULT_SOURCE
33 || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
34
36 The functions ecvt_r(), fcvt_r(), qecvt_r(), and qfcvt_r() are identi‐
37 cal to ecvt(3), fcvt(3), qecvt(3), and qfcvt(3), respectively, except
38 that they do not return their result in a static buffer, but instead
39 use the supplied buf of size len. See ecvt(3) and qecvt(3).
40
42 These functions return 0 on success, and -1 otherwise.
43
45 For an explanation of the terms used in this section, see at‐
46 tributes(7).
47
48 ┌────────────────────────────────────────────┬───────────────┬─────────┐
49 │Interface │ Attribute │ Value │
50 ├────────────────────────────────────────────┼───────────────┼─────────┤
51 │ecvt_r(), fcvt_r(), qecvt_r(), qfcvt_r() │ Thread safety │ MT-Safe │
52 └────────────────────────────────────────────┴───────────────┴─────────┘
53
55 GNU.
56
58 These functions are obsolete. Instead, sprintf(3) is recommended.
59
61 ecvt(3), qecvt(3), sprintf(3)
62
63
64
65Linux man-pages 6.04 2023-03-30 ecvt_r(3)