]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/nextup.3
system.3: wfix
[thirdparty/man-pages.git] / man3 / nextup.3
CommitLineData
c484406d
MK
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.\"
4b8c67d9 25.TH NEXTUP 3 2017-09-15 "GNU" "Linux Programmer's Manual"
c484406d
MK
26.SH NAME
27nextup, nextupf, nextupl, nextdown, nextdownf, nextdownl \-
28return 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>
dbfe9c70 33.PP
c484406d
MK
34.BI "double nextup(double " x );
35.BI "float nextupf(float " x );
36.BI "long double nextupl(long double " x );
dbfe9c70 37.PP
c484406d
MK
38.BI "double nextdown(double " x );
39.BI "float nextdownf(float " x );
40.BI "long double nextdownl(long double " x );
3b3b8d5d 41.fi
dbfe9c70 42.PP
c484406d
MK
43Link with \fI\-lm\fP.
44.SH DESCRIPTION
45The
46.BR nextup (),
47.BR nextupf (),
48and
49.BR nextupl ()
50functions return the next representable floating-point number greater than
51.IR x .
847e0d88 52.PP
c484406d
MK
53If
54.I x
55is the smallest representable negative number in the corresponding type,
56these functions return \-0.
57If
58.I x
59is 0, the returned value is the smallest representable positive number
60of the corresponding type.
847e0d88 61.PP
c484406d
MK
62If
63.I x
64is positive infinity, the returned value is positive infinity.
65If
66.I x
67is negative infinity,
68the returned value is the largest representable finite negative number
69of the corresponding type.
847e0d88 70.PP
c484406d
MK
71If
72.I x
73is Nan,
74the returned value is NaN.
847e0d88 75.PP
c484406d
MK
76The value returned by
77.IR nextdown(x)
78is
79.IR \-nextup(\-x) ,
80and similarly for the other types.
81.SH RETURN VALUE
82See DESCRIPTION.
83.\" .SH ERRORS
2443152c
MK
84.SH VERSIONS
85These functions first appeared in glibc in version 2.24.
ab472b50
MK
86.SH ATTRIBUTES
87For an explanation of the terms used in this section, see
88.BR attributes (7).
89.TS
90allbox;
91lbw36 lb lb
92l l l.
93Interface Attribute Value
94T{
95.BR nextup (),
96.BR nextupf (),
97.BR nextupl (),
98.br
99.BR nextdown (),
100.BR nextdownf (),
101.BR nextdownl ()
102T} Thread safety MT-Safe
103.TE
c484406d
MK
104.SH CONFORMING TO
105These functions are described in
106.IR "IEEE Std 754-2008 - Standard for Floating-Point Arithmetic"
107and
108.IR "ISO/IEC TS 18661".
109.SH SEE ALSO
110.BR nearbyint (3),
111.BR nextafter (3)