logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

nextup, nextupf, nextupl, nextdown, nextdownf, nextdownl - return next floating-point number toward

Attributes

       For an explanation of the terms used in this section, see attributes(7).
       ┌─────────────────────────────────────────────────────────────────────────────┬───────────────┬─────────┐
       │ InterfaceAttributeValue   │
       ├─────────────────────────────────────────────────────────────────────────────┼───────────────┼─────────┤
       │ nextup(), nextupf(), nextupl(), nextdown(), nextdownf(), nextdownl()        │ Thread safety │ MT-Safe │
       └─────────────────────────────────────────────────────────────────────────────┴───────────────┴─────────┘

Description

       The nextup(), nextupf(), and nextupl() functions return  the  next  representable  floating-point  number
       greater than x.

       If  x is the smallest representable negative number in the corresponding type, these functions return -0.
       If x is 0, the returned value is the smallest representable positive number of the corresponding type.

       If x is positive infinity, the returned value is positive infinity.   If  x  is  negative  infinity,  the
       returned value is the largest representable finite negative number of the corresponding type.

       If x is Nan, the returned value is NaN.

       The value returned by nextdown(x) is -nextup(-x), and similarly for the other types.

History

       glibc 2.24.

Library

       Math library (libm, -lm)

Name

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

Return Value

       See DESCRIPTION.

See Also

nearbyint(3), nextafter(3)

Linux man-pages 6.9.1                              2024-05-02                                          nextup(3)

Standards

       These  functions  are described in IEEEStd754-2008-StandardforFloating-PointArithmetic and ISO/IECTS18661.

Synopsis

#define_GNU_SOURCE     /* See feature_test_macros(7) */
       #include<math.h>doublenextup(doublex);floatnextupf(floatx);longdoublenextupl(longdoublex);doublenextdown(doublex);floatnextdownf(floatx);longdoublenextdownl(longdoublex);

See Also