2 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\" <mtk.manpages@gmail.com>
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .TH floor 3 (date) "Linux man-pages (unreleased)"
10 floor, floorf, floorl \- largest integral value not greater than argument
13 .RI ( libm ", " \-lm )
18 .BI "double floor(double " x );
19 .BI "float floorf(float " x );
20 .BI "long double floorl(long double " x );
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
31 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
32 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
33 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
36 These functions return the largest integral value that is not greater than
45 These functions return the floor of
50 is integral, +0, \-0, NaN, or an infinity,
55 POSIX.1-2001 documents a range error for overflows, but see NOTES.
57 For an explanation of the terms used in this section, see
63 Interface Attribute Value
70 T} Thread safety MT-Safe
82 SUSv2 and POSIX.1-2001 contain text about overflow (which might set
89 In practice, the result cannot overflow on any current machine,
90 so this error-handling stuff is just nonsense.
91 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point.
92 (More precisely, overflow can happen only when the maximum value
93 of the exponent is smaller than the number of mantissa bits.
94 For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
95 the maximum value of the exponent is 127 (respectively, 1023),
96 and the number of mantissa bits
97 including the implicit bit
98 is 24 (respectively, 53).)