30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Return Value: Returns the fraction, exppoints to the exponent. If xis 0, the<br />

function<br />

returns 0 for both the fraction and exponent.<br />

Remarks: The absolute value of the fraction is inthe range of 1/2 (inclusive) to 1<br />

(exclusive). No domain orrange error will occur.<br />

Example: #include /* for frexpf */<br />

#include /* for printf */<br />

int main(void)<br />

{<br />

float x,y;<br />

int n;<br />

frexp (Continued)<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

Lỗi: lỗi phạm vi<br />

Đối với một số = 15.000000 và một số mũ = 10000<br />

ldexpf (15.000000, 10000) = inf<br />

ldexpf (Tiếp theo)<br />

Thư viện chuẩn C với hàm toán học<br />

2004 Microchip Technology Inc DS51456B trang 349<br />

đăng nhập<br />

Mô tả: Tính logarit tự nhiên của một điểm chính xác đôi nổi<br />

giá trị.<br />

Bao gồm:<br />

Nguyên mẫu: đăng nhập tăng gấp đôi (double x);<br />

Đối số: x bất kỳ giá trị tích cực mà trả lại đăng nhập<br />

Quay trở lại giá trị: Trả về logarit tự nhiên của x. -infis trả lại nếu XIS 0 và NaN<br />

trả lại nếu XIS một số âm.<br />

Bình luận: Một lỗi miền xảy ra nếu x ≤0.<br />

DS51456B-page 346<br />

x = 0.15F;<br />

y = frexpf (x, &n);<br />

2004 Microchip Technology Inc.<br />

Ví dụ: # include / * Để đăng nhập * /<br />

# include / * Cho printf, perror * /<br />

# include / * Cho errno * /<br />

printf("For frexpf of %f\n the fraction is %f\n ",<br />

x, y);<br />

printf(" and the exponent is %d\n\n", n);<br />

x = -2.5F;<br />

y = frexpf (x, &n);<br />

printf("For frexpf of %f\n the fraction is %f\n ",<br />

x, y);<br />

printf(" and the exponent is %d\n\n", n);<br />

x = 0.0F;<br />

y = frexpf (x, &n);<br />

printf("For frexpf of %f\n the fraction is %f\n ",<br />

x, y);<br />

printf(" and the exponent is %d\n\n", n);<br />

}<br />

Output:<br />

For frexpf of 0.150000<br />

the fraction is 0.600000<br />

and the exponent is -2<br />

For frexpf of -2.500000<br />

the fraction is -0.625000<br />

and the exponent is 2<br />

int main (void)<br />

{<br />

double x, y;<br />

errno = 0;<br />

x = 2,0;<br />

y = log (x);<br />

if (errno)<br />

perror ("Lỗi");<br />

printf ("logarit tự nhiên của% f% f \ n \ n",<br />

x, y);<br />

errno = 0;<br />

x = 0,0;<br />

y = log (x);<br />

if (errno)<br />

perror ("Lỗi");<br />

printf ("logarit tự nhiên của% f% f \ n \ n",<br />

x, y);<br />

errno = 0;<br />

x = -2,0;<br />

y = log (x);<br />

if (errno)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!