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 lround 3 (date) "Linux man-pages (unreleased)"
10 lround, lroundf, lroundl, llround, llroundf, llroundl \- round to
14 .RI ( libm ", " \-lm )
19 .BI "long lround(double " x );
20 .BI "long lroundf(float " x );
21 .BI "long lroundl(long double " x );
23 .BI "long long llround(double " x );
24 .BI "long long llroundf(float " x );
25 .BI "long long llroundl(long double " x );
29 Feature Test Macro Requirements for glibc (see
30 .BR feature_test_macros (7)):
33 All functions shown above:
35 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
38 These functions round their argument to the nearest integer value,
39 rounding halfway cases away from zero,
40 regardless of the current rounding direction (see
47 functions, the return type of these functions differs from
48 that of their arguments.
50 These functions return the rounded integer value.
54 is a NaN or an infinity,
55 or the rounded value is too large to be stored in a
61 then a domain error occurs, and the return value is unspecified.
62 .\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1)
66 for information on how to determine whether an error has occurred
67 when calling these functions.
69 The following errors can occur:
71 Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large
75 An invalid floating-point exception
79 These functions do not set
81 .\" FIXME . Is it intentional that these functions do not set errno?
82 .\" Bug raised: https://www.sourceware.org/bugzilla/show_bug.cgi?id=6797
84 For an explanation of the terms used in this section, see
90 Interface Attribute Value
100 T} Thread safety MT-Safe