ldexp

From cppreference.com
< c‎ | numeric‎ | math
 
 
 
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)(C99)(C99)
Exponential functions
(C99)
(C99)
(C99)
(C99)
Power functions
(C99)
(C99)
Trigonometric and hyperbolic functions
(C99)
(C99)
(C99)
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Nearest integer floating point operations
(C99)(C99)(C99)
(C99)
(C99)
(C99)(C99)(C99)
Floating point manipulation functions
ldexp
(C99)(C99)
(C99)
(C99)
Classification
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)
Macro constants
 
Defined in header <math.h>
float       ldexpf( float arg, int exp );
(since C99)
double      ldexp( double arg, int exp );
long double ldexpl( long double arg, int exp );
(since C99)

Multiplies an floating point value arg by 2 raised to power exp.

[edit] Parameters

arg - floating point value
exp - integer value

[edit] Return value

Returns arg×2exp

If the result is too large for the underlying type, range error occurs and HUGE_VAL is returned.

[edit] See also

decomposes a number into significand and a power of 2
(function)
(C99)(C99)
multiplies a number by FLT_RADIX raised to a power
(function)
C++ documentation for ldexp