Returns the integer portion of x, dropping the fractional portion.
This is also known as "chop" rounding.
pure on all platforms.
real trunc (
) pure nothrow @nogc @trusted;
writeln(trunc(0.01)); // 0 writeln(trunc(0.49)); // 0 writeln(trunc(0.5)); // 0 writeln(trunc(1.5)); // 1
Walter Bright, Don Clugston, Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger