multiply a floating-point number by an integral power of 2
#include <math.h> double ldexp( double x, int exp );
The ldexp() function multiplies a floating-point number by an integral power of 2. A range error may occur.
The value of x times 2 raised to the power exp.
#include <stdio.h> #include <math.h> void main() { double value; value = ldexp( 4.7072345, 5 ); printf( "%f\n", value ); }
produces the output:
150.631504
ANSI
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |