2 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\" <mtk.manpages@gmail.com>
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .TH lrint 3 (date) "Linux man-pages (unreleased)"
10 lrint, lrintf, lrintl, llrint, llrintf, llrintl \- round to nearest integer
13 .RI ( libm ", " \-lm )
18 .BI "long lrint(double " x );
19 .BI "long lrintf(float " x );
20 .BI "long lrintl(long double " x );
22 .BI "long long llrint(double " x );
23 .BI "long long llrintf(float " x );
24 .BI "long long llrintl(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 using the current rounding direction (see
44 the return type of these functions differs from
45 that of their arguments.
47 These functions return the rounded integer value.
51 is a NaN or an infinity,
52 or the rounded value is too large to be stored in a
58 then a domain error occurs, and the return value is unspecified.
59 .\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1)
63 for information on how to determine whether an error has occurred
64 when calling these functions.
66 The following errors can occur:
68 Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large
72 An invalid floating-point exception
76 These functions do not set
78 .\" FIXME . Is it intentional that these functions do not set errno?
79 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6798
81 These functions were added in glibc 2.1.
83 For an explanation of the terms used in this section, see
91 Interface Attribute Value
99 T} Thread safety MT-Safe
105 C99, POSIX.1-2001, POSIX.1-2008.