1 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
27 .TH FLOOR 3 2021-03-22 "" "Linux Programmer's Manual"
29 floor, floorf, floorl \- largest integral value not greater than argument
34 .BI "double floor(double " x );
35 .BI "float floorf(float " x );
36 .BI "long double floorl(long double " x );
42 Feature Test Macro Requirements for glibc (see
43 .BR feature_test_macros (7)):
49 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
50 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
51 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
54 These functions return the largest integral value that is not greater than
63 These functions return the floor of
68 is integral, +0, \-0, NaN, or an infinity,
73 POSIX.1-2001 documents a range error for overflows, but see NOTES.
75 For an explanation of the terms used in this section, see
83 Interface Attribute Value
88 T} Thread safety MT-Safe
94 C99, POSIX.1-2001, POSIX.1-2008.
101 SUSv2 and POSIX.1-2001 contain text about overflow (which might set
108 In practice, the result cannot overflow on any current machine,
109 so this error-handling stuff is just nonsense.
110 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point.
111 (More precisely, overflow can happen only when the maximum value
112 of the exponent is smaller than the number of mantissa bits.
113 For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
114 the maximum value of the exponent is 128 (respectively, 1024),
115 and the number of mantissa bits is 24 (respectively, 53).)