Name

modf function — Separates integer and fraction parts

Synopsis

float modf(float x, float* iptr)
double modf(double x, double* iptr)
long double modf(long double x, long double* iptr)

The modf function splits a floating-point number into integral and fractional parts. Both parts have the same sign as x. The integral part is stored in *iptr; the return value is the fractional part.