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.

{<br />

float x, y;<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

DS51456B-page 328<br />

errno = 0;<br />

x = 2.0F;<br />

y = asinf(x);<br />

if (errno)<br />

perror("Error");<br />

2004 Microchip Technology Inc.<br />

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

errno = 0;<br />

x = 0.0F;<br />

y = asinf(x);<br />

if (errno)<br />

perror("Error");<br />

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

}<br />

Output:<br />

Error: domain error<br />

The arcsine of 2.000000 is nan<br />

The arcsine of 0.000000 is 0.000000<br />

atan<br />

Description: Calculates the trigonometric arc tangent function of a double<br />

precision<br />

floating-point value.<br />

Include: <br />

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

Argument: x value for which to return the arc tangent<br />

Return Value: Returns the arc tangent in radians in the range of -pi/2 to +pi/2<br />

(inclusive).<br />

x = 2.0F;<br />

y = 0.0f;<br />

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

if (errno)<br />

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

printf ("arctangent của% f / f% là% f \ n \ n",<br />

x, y, z);<br />

errno = 0;<br />

x = 0.0f;<br />

y = -1.0F;<br />

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

if (errno)<br />

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

printf ("arctangent của% f / f% là% f \ n \ n",<br />

x, y, z);<br />

errno = 0;<br />

x = 0.0f;<br />

y = 0.0f;<br />

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

if (errno)<br />

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

printf ("arctangent của% f / f% là% f \ n \ n",<br />

x, y, z);<br />

}<br />

Đầu ra:<br />

Các arctangent của 2.000000 / 0.000000 là 1.570796<br />

Các arctangent của 0.000000 / -1,000000 là 3,141593<br />

Lỗi: lỗi miền<br />

Các arctangent của 0.000000 / 0.000000 là nan<br />

dsPIC<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

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

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

DS51456B trang 332<br />

ceil<br />

2004 Microchip Technology Inc<br />

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

int main(void)<br />

{<br />

double x, y;<br />

x = 2.0;<br />

Mô tả: Tính trần của một giá trị.<br />

Bao gồm:<br />

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

Đối số: xa giá trị dấu chấm động mà trở về trần.<br />

Quay trở lại giá trị: Trả về giá trị nguyên nhỏ nhất lớn hơn hoặc bằng x.

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

Saved successfully!

Ooh no, something went wrong!