rint(3) Library Functions Manual rint(3) NOM nearbyint, nearbyintf, nearbyintl, rint, rintf, rintl - Arrondir a l'entier le plus proche BIBLIOTHEQUE Bibliotheque de math (libm, -lm) SYNOPSIS #include double nearbyint(double x); float nearbyintf(float x); long double nearbyintl(long double x); double rint(double x); float rintf(float x); long double rintl(long double x); Exigences de macros de test de fonctionnalites pour la glibc (consulter feature_test_macros(7)) : nearbyint(), nearbyintf(), nearbyintl() : _POSIX_C_SOURCE >= 200112L || _ISOC99_SOURCE rint() : _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 500 || /* Depuis la glibc 2.19 : */ _DEFAULT_SOURCE || /* glibc <= 2.19 : */ _BSD_SOURCE || _SVID_SOURCE rintf(), rintl() : _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* Depuis la glibc 2.19 : */ _DEFAULT_SOURCE || /* glibc <= 2.19 : */ _BSD_SOURCE || _SVID_SOURCE DESCRIPTION Les fonctions nearbyint(), nearbyintf() et nearbyintl() arrondissent leur parametre a l'entier le plus proche, dans un format en virgule flottante, en utilisant la direction d'approximation actuelle (consultez fesetround(3)), et sans declencher l'exception inexact. Quand la direction d'approximation actuelle est vers le plus proche, ces fonctions arrondissent les cas a mi-chemin vers l'entier pair en accord avec la norme IEEE-754. Les fonctions rint(), rintf() et rintl() font la meme chose, mais peuvent declencher l'exception inexact (FE_INEXACT, verifiable par fetestexcept(3)) lorsque le resultat differe du parametre. VALEUR RENVOYEE Ces fonctions renvoient la valeur entiere arrondie. Si x est un nombre entier, +0, -0, NaN ou une valeur infinie, la valeur x elle-meme est renvoyee. ERREURS Aucune erreur n'est survenue' ATTRIBUTS Pour une explication des termes utilises dans cette section, consulter attributes(7). +---------------------------------+--------------------------+---------+ |Interface | Attribut | Valeur | +---------------------------------+--------------------------+---------+ |nearbyint(), nearbyintf(), | Securite des threads | MT-Safe | |nearbyintl(), rint(), rintf(), | | | |rintl() | | | +---------------------------------+--------------------------+---------+ STANDARDS C11, POSIX.1-2008. HISTORIQUE C99, POSIX.1-2001. 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. Si vous voulez stocker la valeur arrondie dans un type entier, vous devriez probablement utiliser une des fonctions decrites dans lrint(3) a la place. VOIR AUSSI ceil(3), floor(3), lrint(3), round(3), trunc(3) TRADUCTION La traduction francaise de cette page de manuel a ete creee par Christophe Blaess , Stephan Rafin , Thierry Vignaud , Francois Micaux, Alain Portal , Jean-Philippe Guerard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas Francois , Florentin Duneau , Simon Paillard , Denis Barbier , David Prevot , Cedric Boutillier et Jean-Pierre Giraud Cette traduction est une documentation libre ; veuillez vous reporter a la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITE LEGALE. Si vous decouvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message a . Pages du manuel de Linux 6.9.1 16 juin 2024 rint(3)