ldexp

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

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Mathematical Computation

Syntax

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

Parameters

x
(IN) Specifies the floating-point number to be multiplied by an integral power of 2.
exp
(IN) Specifies the integral power of 2.

Return Values

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

Remarks

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

See Also

frexp, modf

Example

  #include <math.h>  
  #include <stdio.h>  
   
  main ()  
  {  
     double value;  
     value=ldexp( 4.7072345, 5 );  
     printf ( "%f\n", value );  
  }
  

produces the following:

  150.631504