#include <math.h> double floor(double x); float floorf(float x); long double floorl(long double x);
Exigences de macros de test de fonctionnalités pour la glibc (consulter feature_test_macros(7)) :
floorf(), floorl() :
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
|| /* Depuis la glibc 2.19 : */ _DEFAULT_SOURCE
|| /* glibc <= 2.19 : */ _BSD_SOURCE || _SVID_SOURCE
Par exemple, floor(0,5) vaut 0,0 et floor(-0,5) vaut -1,0.
Si x est un nombre entier, +0, -0, NaN ou une valeur infinie, la valeur x elle-même est renvoyée.
| Interface | Attribut | Valeur |
| floor(), floorf(), floorl() | Sécurité des threads | MT-Safe |
La variante renvoyant double est également conforme à SVr4, 4.3BSD et C89.
SUSv2 and POSIX.1-2001 contain text about overflow (which might set errno to ERANGE, or raise an FE_OVERFLOW exception). In practice, the result cannot overflow on any current machine, so this error-handling stuff was just nonsense. (More precisely, overflow can happen only when the maximum value of the exponent is smaller than the number of mantissa bits. For the IEEE-754 standard 32-bit and 64-bit floating-point numbers the maximum value of the exponent is 127 (respectively, 1023), and the number of mantissa bits including the implicit bit is 24 (respectively, 53).) This was removed in POSIX.1-2008.
Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE.
Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à