Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - ldexp() convert mantissa and exponent to numeric http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ldexp()             Convert mantissa and exponent to numeric
------------------------------------------------------------------------------
 Declaration
   math.hdr

 Syntax
   func dbl ldexp extern
   param value dbl eNumber, ;
         value int iExp

 Arguments
   eMant is a numeric expression used as mantissa.
   iExp is an integer expression used as exponent.

 Return
   The value resulting from the passed mantissa and exponent.

 Description
   The ldexp() function converts a mantissa and an exponent to a
   dbl numeric value. It returns the result of the calculation

   eNumber * 2 ** iExp

   where ** means "raised to the power of".

   Upon function return the value of the __matherror system variable can
   be tested for error values.

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_ldexp
   ? ldexp(  1.0,  24 )   // prints 16777216.0
   ? ldexp(  6.5, -10 )   // prints        0.0063477
   ? ldexp( -2.0,   0 )   // prints       -2.0
   endproc

   proc main
   Test_ldexp()
   endproc

See Also: __matherror frexp()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson