1LROUND(3) Linux Programmer's Manual LROUND(3)
2
3
4
6 lround, lroundf, lroundl, llround, llroundf, llroundl - round to near‐
7 est integer, away from zero
8
10 #include <math.h>
11
12 long int lround(double x);
13 long int lroundf(float x);
14 long int lroundl(long double x);
15
16 long long int llround(double x);
17 long long int llroundf(float x);
18 long long int llroundl(long double x);
19
20 Compile with -std=c99; link with -lm.
21
23 These functions round their argument to the nearest integer value,
24 rounding away from zero, regardless of the current rounding direction.
25 If x is infinite or NaN, or if the rounded value is outside the range
26 of the return type, the numeric result is unspecified. A domain error
27 may occur if the magnitude of x is too large.
28
30 The rounded integer value. Note that unlike round(3), ceil(3), etc.,
31 the return type of these functions differs from that of their argu‐
32 ments.
33
35 EDOM The magnitude of x is too large and (math_errhandling &
36 MATH_ERRNO) is non-zero.
37
39 C99.
40
42 ceil(3), floor(3), lrint(3), nearbyint(3), rint(3), round(3)
43
44
45
46 2001-05-31 LROUND(3)