30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

y = -1.0F;<br />

z = atan2f (y, x);<br />

if (errno)<br />

perror("Error");<br />

printf("The arctangent of %f/%f is %f\n\n",<br />

y, x, z);<br />

errno = 0;<br />

x = 0.0F;<br />

y = 0.0F;<br />

z = atan2f (y, x);<br />

if (errno)<br />

perror("Error");<br />

printf("The arctangent of %f/%f is %f\n\n",<br />

y, x, z);<br />

}<br />

Output:<br />

The arctangent of 2.000000/0.000000 is 1.570796<br />

The arctangent of 0.000000/-1.000000 is 3.141593<br />

Error: domain error<br />

The arctangent of 0.000000/0.000000 is nan<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

DS51456B-page 332 2004 Microchip Technology Inc.<br />

ceil<br />

Description: Calculates the ceiling of a value.<br />

Include: <br />

Prototype: double ceil(double x);<br />

Argument: x a floating-point value for which to return the ceiling.<br />

Return Value: Returns the smallest integer value greater than or equal to x.<br />

Remarks: No domain or range error will occur. See floor.<br />

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

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

int main(void)<br />

{<br />

double x[8] = {2.0, 1.75, 1.5, 1.25, -2.0,<br />

-1.75, -1.5, -1.25};<br />

double y;<br />

int i;<br />

Đầu ra:<br />

Các cô sin của -1,000000 là 0,540302<br />

Các cô sin của 0.000000 là 1.000000<br />

cos (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 335<br />

cosh<br />

Mô tả: Tính hàm cosin hyperbol của một độ chính xác gấp đôi nổi<br />

giá trị điểm.<br />

Bao gồm:<br />

Prototype: cosh đôi (double x);<br />

Đối số: x giá trị mà trả lại cosin hyperbol<br />

Quay trở lại giá trị: Trả về cosin hyperbol của x<br />

Bình luận: Một loạt lỗi sẽ xảy ra nếu độ lớn của XIS quá lớn.<br />

Ví dụ: # include / * Cho cosh * /<br />

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

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

int main (void)<br />

{<br />

double x, y;<br />

errno = 0;<br />

x = -1,5;<br />

y = cosh (x);<br />

if (errno)<br />

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

printf ("cosin hyperbol của% f% f \ n \ n",<br />

x, y);<br />

errno = 0;<br />

x = 0,0;<br />

y = cosh (x);<br />

if (errno)<br />

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

printf ("cosin hyperbol của% f% f \ n \ n",<br />

x, y);<br />

errno = 0;<br />

x = 720,0;<br />

y = cosh (x);<br />

if (errno)<br />

perror ("Lỗi");

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

Saved successfully!

Ooh no, something went wrong!