Hàm ldexp trả về giá trị X nhân 2 mũ Y

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ả:

Hàm lexp trả về x nhân 2 mũ y

Be the first to comment

Leave a Reply