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.

perror("Error");<br />

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

x, y);<br />

}<br />

Output:<br />

The hyperbolic cosine of-1.000000 is 1.543081<br />

The hyperbolic cosine of0.000000 is 1.000000<br />

Error: range error<br />

The hyperbolic cosine of720.000000 is inf<br />

Standard C Libraries with Math Functions<br />

exp<br />

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

Description: Calculates the exponential function ofx (e raised to the power x<br />

where<br />

x is a double precision floating point value).<br />

Include: <br />

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

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

Return Value: Returns the exponential of x. On an overflow, expreturns infand<br />

on<br />

an underflow expreturns 0.<br />

Remarks: A range error occurs if the magnitude of xis too large.<br />

Example: #include /* for exp*/<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 = exp (x);<br />

if (errno)<br />

perror("Error");<br />

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

errno = 0;<br />

x = 1E3;<br />

y = exp (x);<br />

if (errno)<br />

perror("Error");<br />

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

Đối số: x nổi giá trị điểm mà quay trở lại sàn.<br />

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

Bình luận: Không có tên miền hoặc phạm vi lỗi sẽ xảy ra. Xem làm trần nhà.<br />

Ví dụ: # include / * Sàn * /<br />

# include / * Cho 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 />

y kép;<br />

int i;<br />

for (i = 0; i

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

Saved successfully!

Ooh no, something went wrong!