The OpenD Programming Language

nextUp

Calculate the next largest floating point value after x.

Return the least number greater than x that is representable as a real; thus, it gives the next point on the IEEE number line.

Special Values
xnextUp(x)
-∞-real.max
±0.0real.min_normal*real.epsilon
real.max
NaNNaN
  1. real nextUp(real x)
  2. double nextUp(double x)
    @trusted pure nothrow @nogc
    double
    nextUp
    (
    double x
    )
  3. float nextUp(float x)

Examples

assert(nextUp(1.0 - 1.0e-6).feqrel(0.999999) > 16);
assert(nextUp(1.0 - real.epsilon).feqrel(1.0) > 16);

Meta