Debian Codegraph @

upstream/debian-trixie/man3/ecvt_r.3

raw
1 '\" t
2 .\" Copyright (C) 2002 Andries Brouwer <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" This replaces an earlier man page written by Walter Harms
7 .\" <[email protected]>.
8 .\"
9 .\" Corrected return types; from Fabian; 2004-10-05
10 .\"
11 .TH ecvt_r 3 2024-05-02 "Linux man-pages 6.9.1"
12 .SH NAME
13 ecvt_r, fcvt_r, qecvt_r, qfcvt_r \- convert a floating-point number to a string
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <stdlib.h>
20 .P
21 .BI "[[deprecated]] int ecvt_r(double " number ", int " ndigits ,
22 .BI " int *restrict " decpt ", int *restrict " sign ,
23 .BI " char *restrict " buf ", size_t " len );
24 .BI "[[deprecated]] int fcvt_r(double " number ", int " ndigits ,
25 .BI " int *restrict " decpt ", int *restrict " sign ,
26 .BI " char *restrict " buf ", size_t " len );
27 .P
28 .BI "[[deprecated]] int qecvt_r(long double " number ", int " ndigits ,
29 .BI " int *restrict " decpt ", int *restrict " sign ,
30 .BI " char *restrict " buf ", size_t " len );
31 .BI "[[deprecated]] int qfcvt_r(long double " number ", int " ndigits ,
32 .BI " int *restrict " decpt ", int *restrict " sign ,
33 .BI " char *restrict " buf ", size_t " len );
34 .fi
35 .P
36 .RS -4
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
39 .RE
40 .P
41 .BR ecvt_r (),
42 .BR fcvt_r (),
43 .BR qecvt_r (),
44 .BR qfcvt_r ():
45 .nf
46 /* glibc >= 2.19: */ _DEFAULT_SOURCE
47 || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
48 .fi
49 .SH DESCRIPTION
50 The functions
51 .BR ecvt_r (),
52 .BR fcvt_r (),
53 .BR qecvt_r (),
54 and
55 .BR qfcvt_r ()
56 are identical to
57 .BR ecvt (3),
58 .BR fcvt (3),
59 .BR qecvt (3),
60 and
61 .BR qfcvt (3),
62 respectively, except that they do not return their result in a static
63 buffer, but instead use the supplied
64 .I buf
65 of size
66 .IR len .
67 See
68 .BR ecvt (3)
69 and
70 .BR qecvt (3).
71 .SH RETURN VALUE
72 These functions return 0 on success, and \-1 otherwise.
73 .SH ATTRIBUTES
74 For an explanation of the terms used in this section, see
75 .BR attributes (7).
76 .TS
77 allbox;
78 lbx lb lb
79 l l l.
80 Interface Attribute Value
81 T{
82 .na
83 .nh
84 .BR ecvt_r (),
85 .BR fcvt_r (),
86 .BR qecvt_r (),
87 .BR qfcvt_r ()
88 T} Thread safety MT-Safe
89 .TE
90 .SH STANDARDS
91 GNU.
92 .SH NOTES
93 These functions are obsolete.
94 Instead,
95 .BR sprintf (3)
96 is recommended.
97 .SH SEE ALSO
98 .BR ecvt (3),
99 .BR qecvt (3),
100 .BR sprintf (3)