Debian Codegraph @

upstream/fedora-44/man3/nextup.3

raw
1 '\" t
2 .\" Copyright (C) 2016, Michael Kerrisk <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH nextup 3 2024-08-21 "Linux man-pages 6.13"
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 .P
18 .BI "double nextup(double " x );
19 .BI "float nextupf(float " x );
20 .BI "long double nextupl(long double " x );
21 .P
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 .P
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 or \-0,
42 the returned value is
43 the smallest representable positive number of the corresponding type.
44 .P
45 If
46 .I x
47 is positive infinity, the returned value is positive infinity.
48 If
49 .I x
50 is negative infinity,
51 the returned value is the largest representable finite negative number
52 of the corresponding type.
53 .P
54 If
55 .I x
56 is NaN,
57 the returned value is NaN.
58 .P
59 The value returned by
60 .I nextdown(x)
61 is
62 .IR \-nextup(\-x) ,
63 and similarly for the other types.
64 .SH RETURN VALUE
65 See DESCRIPTION.
66 .\" .SH ERRORS
67 .SH ATTRIBUTES
68 For an explanation of the terms used in this section, see
69 .BR attributes (7).
70 .TS
71 allbox;
72 lbx lb lb
73 l l l.
74 Interface Attribute Value
75 T{
76 .na
77 .nh
78 .BR nextup (),
79 .BR nextupf (),
80 .BR nextupl (),
81 .BR nextdown (),
82 .BR nextdownf (),
83 .BR nextdownl ()
84 T} Thread safety MT-Safe
85 .TE
86 .SH STANDARDS
87 These functions are described in
88 .I IEEE Std 754-2008 - Standard for Floating-Point Arithmetic
89 and
90 .IR "ISO/IEC TS 18661".
91 .SH HISTORY
92 glibc 2.24.
93 .SH SEE ALSO
94 .BR nearbyint (3),
95 .BR nextafter (3)