1 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .TH LROUND 3 2021-03-22 "Linux man-pages (unreleased)"
9 lround, lroundf, lroundl, llround, llroundf, llroundl \- round to
13 .RI ( libm ", " \-lm )
18 .BI "long lround(double " x );
19 .BI "long lroundf(float " x );
20 .BI "long lroundl(long double " x );
22 .BI "long long llround(double " x );
23 .BI "long long llroundf(float " x );
24 .BI "long long llroundl(long double " x );
28 Feature Test Macro Requirements for glibc (see
29 .BR feature_test_macros (7)):
32 All functions shown above:
34 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
37 These functions round their argument to the nearest integer value,
38 rounding halfway cases away from zero,
39 regardless of the current rounding direction (see
46 functions, the return type of these functions differs from
47 that of their arguments.
49 These functions return the rounded integer value.
53 is a NaN or an infinity,
54 or the rounded value is too large to be stored in a
60 then a domain error occurs, and the return value is unspecified.
61 .\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1)
65 for information on how to determine whether an error has occurred
66 when calling these functions.
68 The following errors can occur:
70 Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large
74 An invalid floating-point exception
78 These functions do not set
80 .\" FIXME . Is it intentional that these functions do not set errno?
81 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6797
83 These functions first appeared in glibc in version 2.1.
85 For an explanation of the terms used in this section, see
93 Interface Attribute Value
101 T} Thread safety MT-Safe
107 C99, POSIX.1-2001, POSIX.1-2008.