ldexp


ldexp

Multiplies a floating-point number by a power of two

 #include <math.h> double ldexp ( double mantissa , int exponent  ); float ldexpf ( float mantissa , int exponent  );         (C99) long double ldexpl ( long double mantissa , int exponent  );         (C99) 

The ldexp( ) functions calculate a floating-point number from separate mantissa and exponent values. The exponent parameter is an integer exponent to base 2.

The function returns the value mantissa x 2exponent. If the result is not representable in the function's type, a range error may occur.

Example

See the example for frexp( ) in this chapter.

See Also

The function frexp( ), which performs the reverse operation, analyzing a floating-point number into a mantissa and an exponent to base 2.



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net