1GCVT(3)                    Linux Programmer's Manual                   GCVT(3)
2
3
4

NAME

6       gcvt - convert a floating-point number to a string
7

SYNOPSIS

9       #include <stdlib.h>
10
11       char *gcvt(double number, size_t ndigit, char *buf);
12
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       gcvt():
16           Since glibc 2.12:
17               _SVID_SOURCE ||
18                   (_XOPEN_SOURCE >= 500 ||
19                       _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) &&
20                   !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
21           Before glibc 2.12:
22               _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE &&
23               _XOPEN_SOURCE_EXTENDED
24

DESCRIPTION

26       The gcvt() function converts number to a minimal length null-terminated
27       ASCII string and stores the result in buf.  It produces ndigit signifi‐
28       cant digits in either printf(3) F format or E format.
29

RETURN VALUE

31       The gcvt() function returns the address of the  string  pointed  to  by
32       buf.
33

CONFORMING TO

35       Marked  as LEGACY in POSIX.1-2001.  POSIX.1-2008 removes the specifica‐
36       tion of gcvt(), recommending the  use  of  sprintf(3)  instead  (though
37       snprintf(3) may be preferable).
38

SEE ALSO

40       ecvt(3), fcvt(3), sprintf(3)
41

COLOPHON

43       This  page  is  part of release 3.53 of the Linux man-pages project.  A
44       description of the project, and information about reporting  bugs,  can
45       be found at http://www.kernel.org/doc/man-pages/.
46
47
48
49                                  2010-09-20                           GCVT(3)
Impressum