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.
See Also
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.