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