]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/nextup.3
e9d43ab697520d8f58631c270dbce584dfcfcc3f
[thirdparty/man-pages.git] / man3 / nextup.3
1 .\" Copyright (C) 2016, Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH NEXTUP 3 2016-10-08 "GNU" "Linux Programmer's Manual"
26 .SH NAME
27 nextup, nextupf, nextupl, nextdown, nextdownf, nextdownl \-
28 return next floating-point number toward positive/negative infinity
29 .SH SYNOPSIS
30 .nf
31 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
32 .B #include <math.h>
33
34 .BI "double nextup(double " x );
35 .BI "float nextupf(float " x );
36 .BI "long double nextupl(long double " x );
37
38 .BI "double nextdown(double " x );
39 .BI "float nextdownf(float " x );
40 .BI "long double nextdownl(long double " x );
41
42 Link with \fI\-lm\fP.
43 .SH DESCRIPTION
44 The
45 .BR nextup (),
46 .BR nextupf (),
47 and
48 .BR nextupl ()
49 functions return the next representable floating-point number greater than
50 .IR x .
51
52 If
53 .I x
54 is the smallest representable negative number in the corresponding type,
55 these functions return \-0.
56 If
57 .I x
58 is 0, the returned value is the smallest representable positive number
59 of the corresponding type.
60
61 If
62 .I x
63 is positive infinity, the returned value is positive infinity.
64 If
65 .I x
66 is negative infinity,
67 the returned value is the largest representable finite negative number
68 of the corresponding type.
69
70 If
71 .I x
72 is Nan,
73 the returned value is NaN.
74
75 The value returned by
76 .IR nextdown(x)
77 is
78 .IR \-nextup(\-x) ,
79 and similarly for the other types.
80 .SH RETURN VALUE
81 See DESCRIPTION.
82 .\" .SH ERRORS
83 .SH VERSIONS
84 These functions first appeared in glibc in version 2.24.
85 .SH ATTRIBUTES
86 For an explanation of the terms used in this section, see
87 .BR attributes (7).
88 .TS
89 allbox;
90 lbw36 lb lb
91 l l l.
92 Interface Attribute Value
93 T{
94 .BR nextup (),
95 .BR nextupf (),
96 .BR nextupl (),
97 .br
98 .BR nextdown (),
99 .BR nextdownf (),
100 .BR nextdownl ()
101 T} Thread safety MT-Safe
102 .TE
103 .SH CONFORMING TO
104 These functions are described in
105 .IR "IEEE Std 754-2008 - Standard for Floating-Point Arithmetic"
106 and
107 .IR "ISO/IEC TS 18661".
108 .SH SEE ALSO
109 .BR nearbyint (3),
110 .BR nextafter (3)