The OpenD Programming Language

lround

Return the value of x rounded to the nearest integer.

If the fractional part of x is exactly 0.5, the return value is rounded away from zero.

This function is not implemented for Digital Mars C runtime.

@trusted nothrow @nogc
long
lround
(
real x
)

Examples

version (CRuntime_DigitalMars) {}
else
{
    assert(lround(0.49) == 0);
    assert(lround(0.5) == 1);
    assert(lround(1.5) == 2);
}

Meta