Breaks x into an integral part and a fractional part, each of which has the same sign as x. The integral part is stored in i.
real modf (
ref real i
) nothrow @nogc @trusted;
The fractional part of x.
|x||i (on input)||modf(x, i)||i (on return)|
real frac; real intpart; frac = modf(3.14159, intpart); assert(intpart
.feqrel(3.0) > 16); assert(frac .feqrel(0.14159) > 16);
Walter Bright, Don Clugston, Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger