mirror of https://github.com/mkerrisk/man-pages
RETURN VALUE: Added details for special argument cases.
Rewrote ERRORS section; noted that errno is not set; see also http://sources.redhat.com/bugzilla/show_bug.cgi?id=6797. CONFORMING TO: Added POSIX.1-2001.
This commit is contained in:
parent
bf8e66b143
commit
e1520273aa
|
@ -1,4 +1,6 @@
|
||||||
.\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
|
.\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
|
||||||
|
.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
|
||||||
|
.\" <mtk.manpages@gmail.com>
|
||||||
.\"
|
.\"
|
||||||
.\" Permission is granted to make and distribute verbatim copies of this
|
.\" Permission is granted to make and distribute verbatim copies of this
|
||||||
.\" manual provided the copyright notice and this permission notice are
|
.\" manual provided the copyright notice and this permission notice are
|
||||||
|
@ -20,7 +22,7 @@
|
||||||
.\" Formatted or processed versions of this manual, if unaccompanied by
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
||||||
.\" the source, must acknowledge the copyright and authors of this work.
|
.\" the source, must acknowledge the copyright and authors of this work.
|
||||||
.\"
|
.\"
|
||||||
.TH LROUND 3 2007-07-26 "" "Linux Programmer's Manual"
|
.TH LROUND 3 2008-07-29 "" "Linux Programmer's Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
lround, lroundf, lroundl, llround, llroundf, llroundl \- round to
|
lround, lroundf, lroundl, llround, llroundf, llroundl \- round to
|
||||||
nearest integer, away from zero
|
nearest integer, away from zero
|
||||||
|
@ -56,24 +58,48 @@ _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
These functions round their argument to the nearest integer value,
|
These functions round their argument to the nearest integer value,
|
||||||
rounding away from zero, regardless of the current rounding direction.
|
rounding away from zero, regardless of the current rounding direction.
|
||||||
If \fIx\fP is infinite or NaN, or if the rounded value is outside
|
|
||||||
the range of the return type, the numeric result is unspecified.
|
|
||||||
A domain error may occur if the magnitude of \fIx\fP is too large.
|
|
||||||
.SH "RETURN VALUE"
|
|
||||||
The rounded integer value.
|
|
||||||
Note that unlike
|
Note that unlike
|
||||||
.BR round (3),
|
.BR round (3),
|
||||||
.BR ceil (3),
|
.BR ceil (3),
|
||||||
etc., the return type of these functions differs from
|
etc., the return type of these functions differs from
|
||||||
that of their arguments.
|
that of their arguments.
|
||||||
|
.SH "RETURN VALUE"
|
||||||
|
These functions return the rounded integer value.
|
||||||
|
|
||||||
|
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
|
.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
|
.TP
|
||||||
.B EDOM
|
Domain error: \fIx\fP is a NaN or infinite, or the rounded value is too large
|
||||||
The magnitude of \fIx\fP is too large and
|
.\" .I errno
|
||||||
.I "(math_errhandling & MATH_ERRNO)"
|
.\" is set to
|
||||||
is non-zero.
|
.\" .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=6797
|
||||||
.SH "CONFORMING TO"
|
.SH "CONFORMING TO"
|
||||||
C99.
|
C99, POSIX.1-2001.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR ceil (3),
|
.BR ceil (3),
|
||||||
.BR floor (3),
|
.BR floor (3),
|
||||||
|
|
Loading…
Reference in New Issue