]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/nextup.3
7000489a342dc906ad7f974f6d39c35f877fb145
[thirdparty/man-pages.git] / man3 / nextup.3
1 '\" t
2 .\" Copyright (C) 2016, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH nextup 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 nextup, nextupf, nextupl, nextdown, nextdownf, nextdownl \-
9 return next floating-point number toward positive/negative infinity
10 .SH LIBRARY
11 Math library
12 .RI ( libm ", " \-lm )
13 .SH SYNOPSIS
14 .nf
15 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
16 .B #include <math.h>
17 .PP
18 .BI "double nextup(double " x );
19 .BI "float nextupf(float " x );
20 .BI "long double nextupl(long double " x );
21 .PP
22 .BI "double nextdown(double " x );
23 .BI "float nextdownf(float " x );
24 .BI "long double nextdownl(long double " x );
25 .fi
26 .SH DESCRIPTION
27 The
28 .BR nextup (),
29 .BR nextupf (),
30 and
31 .BR nextupl ()
32 functions return the next representable floating-point number greater than
33 .IR x .
34 .PP
35 If
36 .I x
37 is the smallest representable negative number in the corresponding type,
38 these functions return \-0.
39 If
40 .I x
41 is 0, the returned value is the smallest representable positive number
42 of the corresponding type.
43 .PP
44 If
45 .I x
46 is positive infinity, the returned value is positive infinity.
47 If
48 .I x
49 is negative infinity,
50 the returned value is the largest representable finite negative number
51 of the corresponding type.
52 .PP
53 If
54 .I x
55 is Nan,
56 the returned value is NaN.
57 .PP
58 The value returned by
59 .I nextdown(x)
60 is
61 .IR \-nextup(\-x) ,
62 and similarly for the other types.
63 .SH RETURN VALUE
64 See DESCRIPTION.
65 .\" .SH ERRORS
66 .SH ATTRIBUTES
67 For an explanation of the terms used in this section, see
68 .BR attributes (7).
69 .ad l
70 .nh
71 .TS
72 allbox;
73 lbx lb lb
74 l l l.
75 Interface Attribute Value
76 T{
77 .BR nextup (),
78 .BR nextupf (),
79 .BR nextupl (),
80 .BR nextdown (),
81 .BR nextdownf (),
82 .BR nextdownl ()
83 T} Thread safety MT-Safe
84 .TE
85 .hy
86 .ad
87 .sp 1
88 .SH STANDARDS
89 These functions are described in
90 .I IEEE Std 754-2008 - Standard for Floating-Point Arithmetic
91 and
92 .IR "ISO/IEC TS 18661".
93 .SH HISTORY
94 glibc 2.24.
95 .SH SEE ALSO
96 .BR nearbyint (3),
97 .BR nextafter (3)