1 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH LRINT 3 2008-08-05 "" "Linux Programmer's Manual"
27 lrint, lrintf, lrintl, llrint, llrintf, llrintl \- round to nearest integer
32 .BI "long int lrint(double " x );
34 .BI "long int lrintf(float " x );
36 .BI "long int lrintl(long double " x );
38 .BI "long long int llrint(double " x );
40 .BI "long long int llrintf(float " x );
42 .BI "long long int llrintl(long double " x );
48 Feature Test Macro Requirements for glibc (see
49 .BR feature_test_macros (7)):
53 All functions shown above:
54 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
58 These functions round their argument to the nearest integer value,
59 using the current rounding direction (see
64 etc., the return type of these functions differs from
65 that of their arguments.
67 These functions return the rounded integer value.
71 is a NaN or an infinity,
72 or the rounded value is too large to be stored in a
78 then a domain error occurs, and the return value is unspecified.
79 .\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1)
83 for information on how to determine whether an error has occurred
84 when calling these functions.
86 The following errors can occur:
88 Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large
92 An invalid floating-point exception
96 These functions do not set
98 .\" FIXME . Is it intentional that these functions do not set errno?
99 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6798