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(): _SVID_SOURCE || _XOPEN_SOURCE >= 500
16

DESCRIPTION

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

RETURN VALUE

23       The  gcvt()  function  returns  the address of the string pointed to by
24       buf.
25

CONFORMING TO

27       Marked as LEGACY in POSIX.1-2001.  POSIX.1-2008 removes the  specifica‐
28       tion  of  gcvt(),  recommending  the  use of sprintf(3) instead (though
29       snprintf(3) may be preferable).
30

SEE ALSO

32       ecvt(3), fcvt(3), sprintf(3)
33

COLOPHON

35       This page is part of release 3.22 of the Linux  man-pages  project.   A
36       description  of  the project, and information about reporting bugs, can
37       be found at http://www.kernel.org/doc/man-pages/.
38
39
40
41                                  2009-03-15                           GCVT(3)
Impressum