aboutsummaryrefslogtreecommitdiffstats
path: root/man/man3/lrint.3
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-09-05 23:03:38 +0200
committerAlejandro Colomar <alx.manpages@gmail.com>2022-09-05 23:03:47 +0200
commit70ac1c4785fc1e158ab2349a962dba2526bf4fbc (patch)
treebff270e2496dd284bccfc1271b43946f5d225224 /man/man3/lrint.3
parent5423a6f86b2b920a5f3e8cf8d759b513050f2d33 (diff)
downloadman-pages-70ac1c4785fc1e158ab2349a962dba2526bf4fbc.tar.gz
src.mk, All pages: Move man* to man/
The root of the repository is becoming a bit overpopulated and unorganized, due to the recent addition of more mandirs, and more informative and configuration files too. Let's create a specific mandir <man/> that contains the mandirs <man[1-8]*>. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'man/man3/lrint.3')
-rw-r--r--man/man3/lrint.3111
1 files changed, 111 insertions, 0 deletions
diff --git a/man/man3/lrint.3 b/man/man3/lrint.3
new file mode 100644
index 0000000000..240e16db85
--- /dev/null
+++ b/man/man3/lrint.3
@@ -0,0 +1,111 @@
+.\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
+.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
+.\" <mtk.manpages@gmail.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH LRINT 3 2021-03-22 "Linux man-pages (unreleased)"
+.SH NAME
+lrint, lrintf, lrintl, llrint, llrintf, llrintl \- round to nearest integer
+.SH LIBRARY
+Math library
+.RI ( libm ", " \-lm )
+.SH SYNOPSIS
+.nf
+.B #include <math.h>
+.PP
+.BI "long lrint(double " x );
+.BI "long lrintf(float " x );
+.BI "long lrintl(long double " x );
+.PP
+.BI "long long llrint(double " x );
+.BI "long long llrintf(float " x );
+.BI "long long llrintl(long double " x );
+.fi
+.PP
+.RS -4
+Feature Test Macro Requirements for glibc (see
+.BR feature_test_macros (7)):
+.RE
+.PP
+All functions shown above:
+.nf
+ _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
+.fi
+.SH DESCRIPTION
+These functions round their argument to the nearest integer value,
+using the current rounding direction (see
+.BR fesetround (3)).
+.PP
+Note that unlike the
+.BR rint (3)
+family of functions,
+the return type of these functions differs from
+that of their arguments.
+.SH RETURN VALUE
+These functions return the rounded integer value.
+.PP
+If
+.I x
+is a NaN or an infinity,
+or the rounded value is too large to be stored in a
+.I long
+.RI ( "long long"
+in the case of the
+.B ll*
+functions),
+then a domain error occurs, and the return value is unspecified.
+.\" The return value is -(LONG_MAX - 1) or -(LLONG_MAX -1)
+.SH ERRORS
+See
+.BR math_error (7)
+for information on how to determine whether an error has occurred
+when calling these functions.
+.PP
+The following errors can occur:
+.TP
+Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large
+.\" .I errno
+.\" is set to
+.\" .BR EDOM .
+An invalid floating-point exception
+.RB ( FE_INVALID )
+is raised.
+.PP
+These functions do not set
+.IR errno .
+.\" FIXME . Is it intentional that these functions do not set errno?
+.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6798
+.SH VERSIONS
+These functions first appeared in glibc in version 2.1.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.ad l
+.nh
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR lrint (),
+.BR lrintf (),
+.BR lrintl (),
+.BR llrint (),
+.BR llrintf (),
+.BR llrintl ()
+T} Thread safety MT-Safe
+.TE
+.hy
+.ad
+.sp 1
+.SH STANDARDS
+C99, POSIX.1-2001, POSIX.1-2008.
+.SH SEE ALSO
+.BR ceil (3),
+.BR floor (3),
+.BR lround (3),
+.BR nearbyint (3),
+.BR rint (3),
+.BR round (3)