The OpenD Programming Language

rndtol

Returns x rounded to a long value using the current rounding mode. If the integer value of x is greater than long.max, the result is indeterminate.

  1. long rndtol(real x)
  2. long rndtol(double x)
  3. long rndtol(float x)
    pragma(inline, true) @safe pure nothrow @nogc
    long
    rndtol
    (
    float x
    )

Examples

assert(rndtol(1.0) == 1L);
assert(rndtol(1.2) == 1L);
assert(rndtol(1.7) == 2L);
assert(rndtol(1.0001) == 1L);

Meta