1 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH FLOOR 3 2008-08-05 "" "Linux Programmer's Manual"
27 floor, floorf, floorl \- largest integral value not greater than argument
32 .BI "double floor(double " x );
34 .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 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
53 These functions return the smallest integral value that is not greater than
62 These functions return the floor of
65 If \fIx\fP is integral, +0, \-0, NaN, or an infinity,
66 \fIx\fP itself is returned.
69 POSIX.1-2001 documents a range error for overflows, but see NOTES.
77 SUSv2 and POSIX.1-2001 contain text about overflow (which might set
84 In practice, the result cannot overflow on any current machine,
85 so this error-handling stuff is just nonsense.
86 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point.
87 (More precisely, overflow can happen only when the maximum value
88 of the exponent is smaller than the number of mantissa bits.
89 For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
90 the maximum value of the exponent is 128 (respectively, 1024),
91 and the number of mantissa bits is 24 (respectively, 53).)