double ldexp(double x, int exp);
Parameter:
x: cơ số
exp: số mũ
Remark:
Hàm ldexp( ) trả về tích x nhân với 2exp
Ví dụ:
#include <math.h> #include "conio.h" #include <stdio.h> int main( void ) { double x = 4.0, y; int p = 3; y = ldexp(x, p); printf( "%2.1f times two to the power of %d is %2.1f\n", x, p, y ); getch(); }
Kết quả:
Leave a Reply
You must be logged in to post a comment.