1NEXTUP(3)                  Linux Programmer's Manual                 NEXTUP(3)
2
3
4

NAME

6       nextup,  nextupf, nextupl, nextdown, nextdownf, nextdownl - return next
7       floating-point number toward positive/negative infinity
8

SYNOPSIS

10       #define _GNU_SOURCE     /* See feature_test_macros(7) */
11       #include <math.h>
12
13       double nextup(double x);
14       float nextupf(float x);
15       long double nextupl(long double x);
16
17       double nextdown(double x);
18       float nextdownf(float x);
19       long double nextdownl(long double x);
20
21       Link with -lm.
22

DESCRIPTION

24       The nextup(), nextupf(), and nextupl() functions return the next repre‐
25       sentable floating-point number greater than x.
26
27       If x is the smallest representable negative number in the corresponding
28       type, these functions return -0.  If x is 0, the returned value is  the
29       smallest representable positive number of the corresponding type.
30
31       If x is positive infinity, the returned value is positive infinity.  If
32       x is negative infinity, the returned value is the largest representable
33       finite negative number of the corresponding type.
34
35       If x is Nan, the returned value is NaN.
36
37       The value returned by nextdown(x) is -nextup(-x), and similarly for the
38       other types.
39

RETURN VALUE

41       See DESCRIPTION.
42

VERSIONS

44       These functions first appeared in glibc in version 2.24.
45

ATTRIBUTES

47       For  an  explanation  of  the  terms  used   in   this   section,   see
48       attributes(7).
49
50       ┌─────────────────────────────────────┬───────────────┬─────────┐
51Interface                            Attribute     Value   
52       ├─────────────────────────────────────┼───────────────┼─────────┤
53nextup(), nextupf(), nextupl(),      │ Thread safety │ MT-Safe │
54nextdown(), nextdownf(), nextdownl() │               │         │
55       └─────────────────────────────────────┴───────────────┴─────────┘

CONFORMING TO

57       These  functions  are  described  in  IEEE  Std 754-2008 - Standard for
58       Floating-Point Arithmetic and ISO/IEC TS 18661.
59

SEE ALSO

61       nearbyint(3), nextafter(3)
62

COLOPHON

64       This page is part of release 5.07 of the Linux  man-pages  project.   A
65       description  of  the project, information about reporting bugs, and the
66       latest    version    of    this    page,    can     be     found     at
67       https://www.kernel.org/doc/man-pages/.
68
69
70
71GNU                               2017-09-15                         NEXTUP(3)
Impressum