round(3) Library Functions Manual round(3) NOM round, roundf, roundl - Arrondir a l'entier le plus proche en s'eloignant de zero BIBLIOTHEQUE Bibliotheque de math (libm, -lm) SYNOPSIS #include double round(double x); float roundf(float x); long double roundl(long double x); Exigences de macros de test de fonctionnalites pour la glibc (consulter feature_test_macros(7)) : round(), roundf(), roundl() : _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L DESCRIPTION Ces fonctions arrondissent leur x a l'entier le plus proche, en s'eloignant de zero (sans tenir compte de la direction d'approximation en cours, consultez fenv(3)), a la difference de l'arrondi vers l'entier pair le plus proche comme rint(3). Par exemple, round(0,5) vaut 1,0 et round(-0,5) vaut -1,0. 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 | +---------------------------------+--------------------------+---------+ |round(), roundf(), roundl() | Securite des threads | MT-Safe | +---------------------------------+--------------------------+---------+ STANDARDS C11, POSIX.1-2008. HISTORIQUE glibc 2.1. C99, POSIX.1-2001. POSIX.1-2001 contains 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 lround(3) a la place. VOIR AUSSI ceil(3), floor(3), lround(3), nearbyint(3), rint(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 et Cedric Boutillier 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.12 23 juillet 2024 round(3)