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 hyperbolic sine of 0.000000 is 0.000000<br />

Standard C Libraries with Math Functions<br />

sqrt<br />

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

Description: Calculates the square root of a double precision floating point<br />

value.<br />

Include: <br />

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

Argument: x a non-negative floating point value<br />

Return Value: Returns the non-negativesquare root of x..<br />

Remarks: If xis negative, a domain error occurs.<br />

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

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

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

int main(void)<br />

{<br />

double x, y;<br />

errno = 0;<br />

x = 0.0;<br />

y = sqrt (x);<br />

if (errno)<br />

perror("Error");<br />

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

errno = 0;<br />

x = 9.5;<br />

y = sqrt (x);<br />

if (errno)<br />

perror("Error");<br />

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

errno = 0;<br />

x = -25.0;<br />

y = sqrt (x);<br />

if (errno)<br />

perror("Error");<br />

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

}<br />

Output:<br />

The square root of 0.000000 is 0.000000<br />

The square root of 9.500000 is 3.082207<br />

Tang of2.000000 hyperbol là 0,964028<br />

TANF (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 365<br />

tanhf<br />

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

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

Bao gồm:<br />

Prototype: tanhf nổi (float x);<br />

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

Quay trở lại giá trị: Trả về tang hyperbol của xin các phạm vi của -1 đến 1 bao<br />

gồm.<br />

Bình luận: Không có tên miền hoặc rangeerror sẽ xảy ra.<br />

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

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

int main (void)<br />

{<br />

float x, y;<br />

x = -1.0F;<br />

y = tanhf (x);<br />

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

x, y);<br />

x = 0.0f;<br />

y = tanhf (x);<br />

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

x, y);<br />

}<br />

Đầu ra:<br />

Tang hyperbol của -1,000000 là -,761594<br />

Tang hyperbol của 0.000000 là 0.000000<br />

dsPIC<br />

®<br />

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

DS51456B trang 366<br />

4.18 PIC30-libs<br />

2004 Microchip Technology Inc<br />

Các chức năng sau đây là C chức năng trợ giúp thư viện chuẩn:<br />

• _exit chấm dứt thực hiện chương trình<br />

• brk thiết lập kết thúc của không gian dữ liệu của quá trình<br />

• gần đóng một tập tin<br />

• lseek di chuyển một con trỏ tập tin vào một vị trí quy định

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

Saved successfully!

Ooh no, something went wrong!