sourCEntral - mobile manpages

pdf

lround

NOM

lround, lroundf, lroundl, llround, llroundf, llroundl - round to nearest integer

BIBLIOTHÈQUE

Bibliothèque de math (libm, -lm)

SYNOPSIS

#include <math.h>

long lround(double x);
long lroundf(float
x);
long lroundl(long double
x);

long long llround(double x);
long long llroundf(float
x);
long long llroundl(long double
x);

Exigences de macros de test de fonctionnalités pour la glibc (consulter feature_test_macros(7)) :

Pour toutes les fonctions ci-dessus :
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L

DESCRIPTION

These functions round their argument to the nearest integer value, rounding halfway cases away from zero, regardless of the current rounding direction (see fenv(3)).

Notez que contrairement aux fonctions round(3) et ceil(3), le type de la valeur renvoyée est différent du type de leur paramètre.

VALEUR RENVOYÉE

Ces fonctions renvoient la valeur entière arrondie.

Si x est un Nan ou un infini ou si la valeur arrondie est trop importante pour être stockée dans un long (ou un long long dans le cas des fonction ll*), une erreur de domaine se produit et la valeur de retour n’est pas spécifiée.

ERREURS

Voir math_error(7) pour savoir comment déterminer si une erreur s’est produite lors de l’appel d’une de ces fonctions.

Les erreurs suivantes peuvent se produire :
Erreur de domaine : x est un NaN ou un infini ou la valeur arrondie est
trop importante

Une exception indiquant une virgule flottante non valable (FE_INVALID) est levée.

Ces fonctions n’affectent pas de valeur à errno.

VERSIONS

Ces fonctions ont été ajoutées dans la glibc 2.1.

ATTRIBUTS

Pour une explication des termes utilisés dans cette section, consulter attributes(7).

img

STANDARDS

C99, POSIX.1-2001, POSIX.1-2008.

VOIR AUSSI

ceil(3), floor(3), lrint(3), nearbyint(3), rint(3), round(3)

TRADUCTION

La traduction française de cette page de manuel a été créée par Christophe Blaess <https://www.blaess.fr/christophe/>, Stéphan Rafin <stephan DOT rafin AT laposte DOT net>, Thierry Vignaud <tvignaud AT mandriva DOT com>, François Micaux, Alain Portal <aportal AT univ-montp2 DOT fr>, Jean-Philippe Guérard <fevrier AT tigreraye DOT org>, Jean-Luc Coulon (f5ibh) <jean-luc DOT coulon AT wanadoo DOT fr>, Julien Cristau <jcristau AT debian DOT org>, Thomas Huriaux <thomas DOT huriaux AT gmail DOT com>, Nicolas François <nicolas DOT francois AT centraliens DOT net>, Florentin Duneau <fduneau AT gmail DOT com>, Simon Paillard <simon DOT paillard AT resel DOT enst-bretagne DOT fr>, Denis Barbier <barbier AT debian DOT org>, David Prévot <david AT tilapin DOT org> et Cédric Boutillier <cedric DOT boutillier AT gmail DOT com>

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 à debian-l10n-french.

pdf