]>
Commit | Line | Data |
---|---|---|
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 |
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> | |
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 |
43 | Link with \fI\-lm\fP. |
44 | .SH DESCRIPTION | |
45 | The | |
46 | .BR nextup (), | |
47 | .BR nextupf (), | |
48 | and | |
49 | .BR nextupl () | |
50 | functions return the next representable floating-point number greater than | |
51 | .IR x . | |
847e0d88 | 52 | .PP |
c484406d MK |
53 | If |
54 | .I x | |
55 | is the smallest representable negative number in the corresponding type, | |
56 | these functions return \-0. | |
57 | If | |
58 | .I x | |
59 | is 0, the returned value is the smallest representable positive number | |
60 | of the corresponding type. | |
847e0d88 | 61 | .PP |
c484406d MK |
62 | If |
63 | .I x | |
64 | is positive infinity, the returned value is positive infinity. | |
65 | If | |
66 | .I x | |
67 | is negative infinity, | |
68 | the returned value is the largest representable finite negative number | |
69 | of the corresponding type. | |
847e0d88 | 70 | .PP |
c484406d MK |
71 | If |
72 | .I x | |
73 | is Nan, | |
74 | the returned value is NaN. | |
847e0d88 | 75 | .PP |
c484406d MK |
76 | The value returned by |
77 | .IR nextdown(x) | |
78 | is | |
79 | .IR \-nextup(\-x) , | |
80 | and similarly for the other types. | |
81 | .SH RETURN VALUE | |
82 | See DESCRIPTION. | |
83 | .\" .SH ERRORS | |
2443152c MK |
84 | .SH VERSIONS |
85 | These functions first appeared in glibc in version 2.24. | |
ab472b50 MK |
86 | .SH ATTRIBUTES |
87 | For an explanation of the terms used in this section, see | |
88 | .BR attributes (7). | |
89 | .TS | |
90 | allbox; | |
91 | lbw36 lb lb | |
92 | l l l. | |
93 | Interface Attribute Value | |
94 | T{ | |
95 | .BR nextup (), | |
96 | .BR nextupf (), | |
97 | .BR nextupl (), | |
98 | .br | |
99 | .BR nextdown (), | |
100 | .BR nextdownf (), | |
101 | .BR nextdownl () | |
102 | T} Thread safety MT-Safe | |
103 | .TE | |
c484406d MK |
104 | .SH CONFORMING TO |
105 | These functions are described in | |
106 | .IR "IEEE Std 754-2008 - Standard for Floating-Point Arithmetic" | |
107 | and | |
108 | .IR "ISO/IEC TS 18661". | |
109 | .SH SEE ALSO | |
110 | .BR nearbyint (3), | |
111 | .BR nextafter (3) |