[Previous]
[Contents]
[Next]

ldexp()

multiply a floating-point number by an integral power of 2

Synopsis:

#include <math.h>
double ldexp( double x, int exp );

Description:

The ldexp() function multiplies a floating-point number by an integral power of 2. A range error may occur.

Returns:

The value of x times 2 raised to the power exp.

Examples:

#include <stdio.h>
#include <math.h>

void main()
  {
    double value;

    value = ldexp( 4.7072345, 5 );
    printf( "%f\n", value );
  }

produces the output:

150.631504

Classification:

ANSI

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

frexp(), modf()


[Previous]
[Contents]
[Next]