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

NAME

6       floor,  floorf,  floorl - largest integral value not greater than argu‐
7       ment
8

SYNOPSIS

10       #include <math.h>
11
12       double floor(double x);
13       float floorf(float x);
14       long double floorl(long double x);
15
16       Link with -lm.
17
18   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20       floorf(), floorl():
21           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
22               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23               || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24

DESCRIPTION

26       These functions return the largest integral value that is  not  greater
27       than x.
28
29       For example, floor(0.5) is 0.0, and floor(-0.5) is -1.0.
30

RETURN VALUE

32       These functions return the floor of x.
33
34       If x is integral, +0, -0, NaN, or an infinity, x itself is returned.
35

ERRORS

37       No  errors  occur.  POSIX.1-2001 documents a range error for overflows,
38       but see NOTES.
39

ATTRIBUTES

41       For  an  explanation  of  the  terms  used   in   this   section,   see
42       attributes(7).
43
44       ┌────────────────────────────┬───────────────┬─────────┐
45Interface                   Attribute     Value   
46       ├────────────────────────────┼───────────────┼─────────┤
47floor(), floorf(), floorl() │ Thread safety │ MT-Safe │
48       └────────────────────────────┴───────────────┴─────────┘

CONFORMING TO

50       C99, POSIX.1-2001, POSIX.1-2008.
51
52       The variant returning double also conforms to SVr4, 4.3BSD, C89.
53

NOTES

55       SUSv2  and  POSIX.1-2001  contain  text about overflow (which might set
56       errno to ERANGE, or raise an FE_OVERFLOW exception).  In practice,  the
57       result  cannot  overflow on any current machine, so this error-handling
58       stuff is just nonsense.  (More precisely, overflow can happen only when
59       the  maximum  value  of the exponent is smaller than the number of man‐
60       tissa bits.  For the IEEE-754 standard 32-bit and 64-bit floating-point
61       numbers  the maximum value of the exponent is 128 (respectively, 1024),
62       and the number of mantissa bits is 24 (respectively, 53).)
63

SEE ALSO

65       ceil(3), lrint(3), nearbyint(3), rint(3), round(3), trunc(3)
66

COLOPHON

68       This page is part of release 5.04 of the Linux  man-pages  project.   A
69       description  of  the project, information about reporting bugs, and the
70       latest    version    of    this    page,    can     be     found     at
71       https://www.kernel.org/doc/man-pages/.
72
73
74
75                                  2017-09-15                          FLOOR(3)
Impressum