MODF(3) Library Functions Manual MODF(3)

modfreturn integral and fractional parts

#include <math.h>

double
modf(double value, double *iptr);

long double
modfl(long double value, long double *iptr);

float
modff(float value, float *iptr);

The () break value into integral and fractional parts, each of which has the same sign as the argument. They return the fractional part, and store the integral part (as a floating-point number) in the object pointed to by iptr

modf(±infinity, iptr) returns ±0 and stores ±infinity in the object pointed to by iptr.

(NaN, iptr) returns a NaN and stores a NaN in the object pointed to by iptr.

frexp(3), ldexp(3), math(3)

The modf() functions conform to ISO/IEC 9899:2011.

December 11, 2006 macOS 15.0