]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/nextafter.3
Import of man-pages 1.70
[thirdparty/man-pages.git] / man3 / nextafter.3
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
6 nextafter, 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
22 Link with \-lm.
23 .SH DESCRIPTION
24 The
25 .B nextafter()
26 functions return the next representable neighbor of
27 \fIx\fP in the direction towards \fIy\fP. The size of the step
28 between \fIx\fP and the result depends on the type of the result.
29 If \fIx\fP = \fIy\fP the function simply returns \fIy\fP.
30 If either value is
31 .IR NaN ,
32 then
33 .I NaN
34 is returned. Otherwise a value corresponding to the value of the
35 least significant bit in the mantissa is added or subtracted,
36 depending on the direction.
37 .PP
38 The
39 .B nexttoward()
40 functions do the same as the
41 .B nextafter()
42 functions, except that they have a long double second argument.
43 .PP
44 These functions will signal overflow or underflow if the result
45 goes outside of the range of normalized numbers.
46 .SH "CONFORMING TO"
47 C99. This function is defined in IEC 559 (and the appendix with
48 recommended functions in IEEE 754/IEEE 854).
49 .SH "SEE ALSO"
50 .BR nearbyint (3)