return integral and fractional parts

You're viewing an older version of this page (#3262). View the current version.

View versions (4)

NAME

modf

INTERFACE

#include <math.h>

double modf ( double value, double *iptr ) long modfl ( long double value, long double *iptr ) float modff ( float value, float *iptr )

DESCRIPTION

The modf functions 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

SPECIAL VALUES

modf ( &plusmn;&infin;, iptr) returns &plusmn;0 and stores &plusmn;&infin; in the object pointed to by iptr. modf ( NaN, iptr) returns a NaN and stores a NaN in the object pointed to by iptr.

SEE ALSO

frexp (3) , ldexp (3)

STANDARDS

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