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.

The ceiling for 2.000000 is 2.000000<br />

The ceiling for 1.750000 is 2.000000<br />

The ceiling for 1.500000 is 2.000000<br />

The ceiling for 1.250000 is 2.000000<br />

The ceiling for -2.000000 is -2.000000<br />

The ceiling for -1.750000 is -1.000000<br />

The ceiling for -1.500000 is -1.000000<br />

The ceiling for -1.250000 is -1.000000<br />

cos<br />

Description: Calculates the trigonometric cosine function of a double precision<br />

floating point value.<br />

Include: <br />

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

Argument: x value for which toreturn the cosine<br />

Return Value: Returns the cosine of xin radians in the ranges of -1 to 1<br />

inclusive.<br />

Remarks: A domain error will occur if xis a NaN or infinity.<br />

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

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

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

int main(void)<br />

{<br />

double x,y;<br />

errno = 0;<br />

x = -1.0;<br />

y = cos (x);<br />

if (errno)<br />

perror("Error");<br />

printf("The cosine of%f is %f\n\n", x, y);<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

x, y);<br />

errno = 0;<br />

x = 720.0F;<br />

y = coshf (x);<br />

if (errno)<br />

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

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

x, y);<br />

}<br />

Đầu ra:<br />

Cosin hyperbol của-1.000000 là 1.543081<br />

Cosin hyperbol of0.000000 là 1,000000<br />

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

Cosin hyperbol of720.000000 là inf<br />

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

2004 Microchip Technology Inc DS51456B trang 337<br />

exp<br />

Mô tả: Tính hàm OFX mũ (e lũy thừa x nơi<br />

x là độ chính xác gấp đôi giá trị nổi điểm).<br />

Bao gồm:<br />

Prototype: điểm kinh nghiệm gấp đôi (double x);<br />

Đối số: x giá trị mà để trả lại theo cấp số nhân<br />

Quay trở lại giá trị: Trả về số mũ của x. Trên một tràn, expreturns infand trên<br />

Van cân bằng một expreturns 0.<br />

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

Ví dụ: # include / * Cho điểm kinh nghiệm * /<br />

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

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

int main (void)<br />

{<br />

double x, y;<br />

errno = 0;<br />

DS51456B-page 334<br />

errno = 0;<br />

x = 0.0;<br />

y = cos (x);<br />

if (errno)<br />

perror("Error");<br />

2004 Microchip Technology Inc.<br />

x = 1,0;<br />

y = exp (x);<br />

if (errno)<br />

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

printf ("mũ của% f% f \ n \ n", x, y);<br />

errno = 0;<br />

printf("The cosine of %f is %f\n\n", x, y);<br />

x = 1E3;

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

Saved successfully!

Ooh no, something went wrong!