Concept Framework 2.0 documentation Contents | Index

standard.C.math.ldexp

Name Version Deprecated
ldexp version 1.0 no

Prototype:
number ldexp(number x, number exp)

Parameters:
x      [in] Any number
exp      [in] Integer exponent

Description:
Computes a real number from the mantissa and exponent. Returns the value of x * 2^exp if successful.
On overflow (depending on the sign of x), ldexp returns +/- indefinite.

Example:
import standard.C.math

class Main {
     function Main() {
          var x = 4;
          var y;
          var p = 3;

          y = ldexp(x, p);
          echo "" + x + " times two to the power of " + p + " is " + y;
     }
} 
 

Results 
4 times two to the power of 3 is 32  

Returns:
Returns the value of x * 2^exp if successful. On overflow (depending on the sign of x), ldexp returns +/- indefinite.

Documented by Simona Gabriela Plesuvu, generation time: Fri Jan 21 18:06:18 2011 GMT(c)2011 RadGs Software