]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/nextafter.3
Automated unformatting of parentheses using unformat_parens.sh
[thirdparty/man-pages.git] / man3 / nextafter.3
CommitLineData
fea681da
MK
1.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2.\" Distributed under GPL
3.\" Based on glibc infopages
4.TH NEXTAFTER 3 2002-08-10 "GNU" "libc math functions"
5.SH NAME
6nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \- floating point number manipulation
7.SH SYNOPSIS
8.B #include <math.h>
9.sp
10.BI "double nextafter(double " x ", double " y );
11.br
12.BI "float nextafterf(float " x ", float " y );
13.br
14.BI "long double nextafterl(long double " x ", long double " y );
15.sp
16.BI "double nexttoward(double " x ", long double " y );
17.br
18.BI "float nexttowardf(float " x ", long double " y );
19.br
20.BI "long double nexttowardl(long double " x ", long double " y );
21.sp
22Link with \-lm.
23.SH DESCRIPTION
24The
63aa9df0 25.BR nextafter ()
fea681da
MK
26functions return the next representable neighbor of
27\fIx\fP in the direction towards \fIy\fP. The size of the step
28between \fIx\fP and the result depends on the type of the result.
29If \fIx\fP = \fIy\fP the function simply returns \fIy\fP.
30If either value is
31.IR NaN ,
32then
33.I NaN
34is returned. Otherwise a value corresponding to the value of the
35least significant bit in the mantissa is added or subtracted,
36depending on the direction.
37.PP
38The
63aa9df0 39.BR nexttoward ()
fea681da 40functions do the same as the
63aa9df0 41.BR nextafter ()
fea681da
MK
42functions, except that they have a long double second argument.
43.PP
44These functions will signal overflow or underflow if the result
45goes outside of the range of normalized numbers.
46.SH "CONFORMING TO"
47C99. This function is defined in IEC 559 (and the appendix with
48recommended functions in IEEE 754/IEEE 854).
49.SH "SEE ALSO"
50.BR nearbyint (3)