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, int 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               (_XOPEN_SOURCE >= 500) ! (_POSIX_C_SOURCE >= 200112L)
18                   || /* Glibc since 2.19: */ _DEFAULT_SOURCE
19                   || /* Glibc versions <= 2.19: */ _SVID_SOURCE
20           Before glibc 2.12:
21               _SVID_SOURCE || _XOPEN_SOURCE >= 500
22

DESCRIPTION

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

RETURN VALUE

29       The gcvt() function returns buf.
30

ATTRIBUTES

32       For   an   explanation   of   the  terms  used  in  this  section,  see
33       attributes(7).
34
35       ┌──────────┬───────────────┬─────────┐
36Interface Attribute     Value   
37       ├──────────┼───────────────┼─────────┤
38gcvt()    │ Thread safety │ MT-Safe │
39       └──────────┴───────────────┴─────────┘
40

CONFORMING TO

42       Marked as LEGACY in POSIX.1-2001.  POSIX.1-2008 removes the  specifica‐
43       tion  of  gcvt(),  recommending  the  use of sprintf(3) instead (though
44       snprintf(3) may be preferable).
45

SEE ALSO

47       ecvt(3), fcvt(3), sprintf(3)
48

COLOPHON

50       This page is part of release 5.07 of the Linux  man-pages  project.   A
51       description  of  the project, information about reporting bugs, and the
52       latest    version    of    this    page,    can     be     found     at
53       https://www.kernel.org/doc/man-pages/.
54
55
56
57                                  2017-09-15                           GCVT(3)
Impressum