2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" Modified Sat Jul 24 19:32:25 1993 by Rik Faith (faith@cs.unc.edu)
11 .TH gcvt 3 (date) "Linux man-pages (unreleased)"
13 gcvt \- convert a floating-point number to a string
16 .RI ( libc ", " \-lc )
19 .B #include <stdlib.h>
21 .BI "char *gcvt(double " number ", int " ndigit ", char *" buf );
25 Feature Test Macro Requirements for glibc (see
26 .BR feature_test_macros (7)):
32 (_XOPEN_SOURCE >= 500 && ! (_POSIX_C_SOURCE >= 200809L))
33 || /* glibc >= 2.20 */ _DEFAULT_SOURCE
34 || /* glibc <= 2.19 */ _SVID_SOURCE
35 glibc 2.12 to glibc 2.16:
36 (_XOPEN_SOURCE >= 500 && ! (_POSIX_C_SOURCE >= 200112L))
39 _SVID_SOURCE || _XOPEN_SOURCE >= 500
40 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
45 function converts \fInumber\fP to a minimal length null-terminated
46 ASCII string and stores the result in \fIbuf\fP.
47 It produces \fIndigit\fP significant digits in either
56 For an explanation of the terms used in this section, see
64 Interface Attribute Value
67 T} Thread safety MT-Safe
73 Marked as LEGACY in POSIX.1-2001.
74 POSIX.1-2008 removes the specification of
76 recommending the use of