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.

@trusted nothrow @nogc
long
lround
(
real x
)

Examples

assert(lround(0.49) == 0);
assert(lround(0.5) == 1);
assert(lround(1.5) == 2);

Meta