2004-11-03 13:51:07 +00:00
|
|
|
.\" 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
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR nextafter ()
|
2004-11-03 13:51:07 +00:00
|
|
|
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
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR nexttoward ()
|
2004-11-03 13:51:07 +00:00
|
|
|
functions do the same as the
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR nextafter ()
|
2004-11-03 13:51:07 +00:00
|
|
|
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)
|