summaryrefslogtreecommitdiffstats
path: root/man3/nextafter.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/nextafter.3')
-rw-r--r--man3/nextafter.350
1 files changed, 50 insertions, 0 deletions
diff --git a/man3/nextafter.3 b/man3/nextafter.3
new file mode 100644
index 000000000..40baea4ec
--- /dev/null
+++ b/man3/nextafter.3
@@ -0,0 +1,50 @@
+.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
+.\" Distributed under GPL
+.\" Based on glibc infopages
+.TH NEXTAFTER 3 2002-08-10 "GNU" "libc math functions"
+.SH NAME
+nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, nexttowardl \- floating point number manipulation
+.SH SYNOPSIS
+.B #include <math.h>
+.sp
+.BI "double nextafter(double " x ", double " y );
+.br
+.BI "float nextafterf(float " x ", float " y );
+.br
+.BI "long double nextafterl(long double " x ", long double " y );
+.sp
+.BI "double nexttoward(double " x ", long double " y );
+.br
+.BI "float nexttowardf(float " x ", long double " y );
+.br
+.BI "long double nexttowardl(long double " x ", long double " y );
+.sp
+Link with \-lm.
+.SH DESCRIPTION
+The
+.B nextafter()
+functions return the next representable neighbor of
+\fIx\fP in the direction towards \fIy\fP. The size of the step
+between \fIx\fP and the result depends on the type of the result.
+If \fIx\fP = \fIy\fP the function simply returns \fIy\fP.
+If either value is
+.IR NaN ,
+then
+.I NaN
+is returned. Otherwise a value corresponding to the value of the
+least significant bit in the mantissa is added or subtracted,
+depending on the direction.
+.PP
+The
+.B nexttoward()
+functions do the same as the
+.B nextafter()
+functions, except that they have a long double second argument.
+.PP
+These functions will signal overflow or underflow if the result
+goes outside of the range of normalized numbers.
+.SH "CONFORMING TO"
+C99. This function is defined in IEC 559 (and the appendix with
+recommended functions in IEEE 754/IEEE 854).
+.SH "SEE ALSO"
+.BR nearbyint (3)