modf [C++ Reference]
Keywords: c,math,modf
Date: 2009-03-20T00:05:06-0700

[[modf]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## modf

Syntax:

        #include <cmath>
        double modf( double num, double *i );

The function modf() splits num into its integer and fraction parts. It returns the fractional part and loads the integer part into i.

C++ also provides the following overloaded forms:

        #include <cmath>
        float modf( float num, float *i ); // same as modff() in C99
        long double modf( long double num, long double *i ); // same as modfl() in C99

Related Topics: frexp, ldexp

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •