ldexp

Syntax:

    #include <cmath>
    double ldexp( double num, int exp );

The ldexp() function returns num * (2 ^ exp). And get this: if an overflow occurs, HUGE_VAL is returned.

C++ also provides the following overloaded forms:

    #include <cmath>
    float ldexp( float num, int exp ); // same as ldexpf() in C99
    long double ldexp( long double num, int exp ); // same as ldexpl() in C99

Related Topics: frexp, modf