]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/nextafter.3
Wrap long lines; start sentences on new lines
[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 \-
7 floating point number manipulation
8 .SH SYNOPSIS
9 .B #include <math.h>
10 .sp
11 .BI "double nextafter(double " x ", double " y );
12 .br
13 .BI "float nextafterf(float " x ", float " y );
14 .br
15 .BI "long double nextafterl(long double " x ", long double " y );
16 .sp
17 .BI "double nexttoward(double " x ", long double " y );
18 .br
19 .BI "float nexttowardf(float " x ", long double " y );
20 .br
21 .BI "long double nexttowardl(long double " x ", long double " y );
22 .sp
23 Link with \-lm.
24 .SH DESCRIPTION
25 The
26 .BR nextafter ()
27 functions return the next representable neighbor of
28 \fIx\fP in the direction towards \fIy\fP.
29 The size of the step
30 between \fIx\fP and the result depends on the type of the result.
31 If \fIx\fP = \fIy\fP the function simply returns \fIy\fP.
32 If either value is
33 .IR NaN ,
34 then
35 .I NaN
36 is returned.
37 Otherwise a value corresponding to the value of the
38 least significant bit in the mantissa is added or subtracted,
39 depending on the direction.
40 .PP
41 The
42 .BR nexttoward ()
43 functions do the same as the
44 .BR nextafter ()
45 functions, except that they have a long double second argument.
46 .PP
47 These functions will signal overflow or underflow if the result
48 goes outside of the range of normalized numbers.
49 .SH "CONFORMING TO"
50 C99.
51 This function is defined in IEC 559 (and the appendix with
52 recommended functions in IEEE 754/IEEE 854).
53 .SH "SEE ALSO"
54 .BR nearbyint (3)