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.

errno = 0;<br />

x = -2.0;<br />

y = log (x);<br />

if (errno)<br />

perror("Error");<br />

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

x, y);<br />

}<br />

Output:<br />

The natural logarithm of2.000000 is 0.693147<br />

The natural logarithm of0.000000 is -inf<br />

Error: domain error<br />

The natural logarithm of -2.000000 is nan<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

Bình luận: Giá trị tuyệt đối của các phần phân đoạn nằm trong khoảng từ 0 (bao<br />

gồm)<br />

1 (độc quyền). Không có lỗi nhiều domainor sẽ xảy ra.<br />

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

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

int main (void)<br />

{<br />

double x, y, n;<br />

x = 0,707;<br />

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

printf ("% f Đối với phần là% f \ n", x, y);<br />

printf ("và các số nguyên là 0.f% \ n \ n", n);<br />

x = -15,2121;<br />

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

printf ("% f Đối với phần là% f \ n", x, y);<br />

printf ("và các số nguyên là 0.f% \ n \ n", n);<br />

}<br />

DS51456B-page 350<br />

log10<br />

2004 Microchip Technology Inc.<br />

Đầu ra:<br />

Đối với 0.707000 phần là 0.707000<br />

Description: Calculates the base-10 logarithm of a double precision floating<br />

point<br />

value.<br />

Include: <br />

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

Argument: x any double precision floating point positive number<br />

Return Value: Returns the base-10 logarithm of x. -infis returned if xis 0 and<br />

NaN<br />

is returned if xis a negative number.<br />

Remarks: A domain error occurs if x ≤0.<br />

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

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

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

int main(void)<br />

{<br />

double x, y;<br />

errno = 0;<br />

x = 2.0;<br />

y = log10 (x);<br />

if (errno)<br />

perror("Error");<br />

printf("The base-10 logarithm of %f is %f\n\n",<br />

và các số nguyên là 0<br />

Đối với -15,212100 phần là -,212100<br />

và các số nguyên là -15<br />

dsPIC<br />

®<br />

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

DS51456B trang 354<br />

modff<br />

2004 Microchip Technology Inc<br />

Mô tả: Tách một độ chính xác giá trị dấu chấm duy nhất vào phân đoạn và số<br />

nguyên<br />

các bộ phận.<br />

Bao gồm:<br />

Prototype: modff nổi (float x, float * pint);<br />

Đối số: x độ chính xác đơn giá trị dấu chấm<br />

con trỏ pint để phần nguyên lưu trữ<br />

Quay trở lại giá trị: Trả về phần thập phân có chữ ký và pintpoints đến phần<br />

nguyên.<br />

Bình luận: Giá trị tuyệt đối của các phần phân đoạn nằm trong khoảng từ 0 (bao<br />

gồm)<br />

1 (độc quyền). Không có lỗi nhiều domainor sẽ xảy ra.<br />

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

# include / * Cho printf * /

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

Saved successfully!

Ooh no, something went wrong!