Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

modf, modff, modfl - split floating-point number into integral and fractional parts

&pagelevel(4)&pagelevel

Syntax

#include <math.h>

double modf(double x, double *iptr);
float modff(float x, float *iptr);
long double modfl(long double x, long double *iptr);

Description

These functions split a floating-point number x into its integral and fractional parts. Both parts receive the sign of x. The functions return the fractional part of x as the result and writes the integral part as a floating-point value to the address to which iptr points.

Return val.

Fractional part of x with the sign of x

Notes

The iptr argument must be a pointer!

See also

frexp(), ldexp()trunc(), math.h.