Definition | #include <math.h> double ldexp(double x, int exp); Given its arguments x (mantissa) and exp (exponent), these functions calculate the number: x * 2exp
| |
Return val. | x * 2exp | if successful. |
| depending on the function type and the sign of x, if an overflow occurs. | |
Example |
#include <stdio.h> #include <math.h> int main(void) { double x; int ex; x = frexp(5.342, &ex); printf("Mantissa : %f\nexponent : %d\n", x, ex); printf("Initial value : %f\n", ldexp(x, ex)); return 0; } | |
See also | frexp, modf |