The C library function double ldexp(double x, int exponent) returns x multiplied by 2 raised to the power of exponent.
double ldexp(double x, int exponent)
#include #include int main () { double x, ret; int n; x = 0.65; n = 3; ret = ldexp(x ,n); printf("%f * 2^%d = %f\n", x, n, ret); return(0); }
0.650000 * 2^3 = 5.200000