17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Also See:<br />

labs()<br />

sin( ) cos( ) tan( ) asin( ) acos() atan() sinh() cosh() tanh()<br />

atan2()<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

val = sin (rad)<br />

val = cos (rad)<br />

val = tan (rad)<br />

rad = asin (val)<br />

rad1 = acos (val)<br />

rad = atan (val)<br />

rad2=atan2(val, val)<br />

result=sinh(value)<br />

result=cosh(value)<br />

result=tanh(value)<br />

rad is a float representing an angle in Radians -2pi to 2pi.<br />

val is a float with the range -1.0 to 1.0.<br />

Value is a float<br />

rad is a float representing an angle in Radians -pi/2 to pi/2<br />

val is a float with the range -1.0 to 1.0.<br />

rad1 is a float representing an angle in Radians 0 to pi<br />

rad2 is a float representing an angle in Radians -pi to pi<br />

Result is a float<br />

Function:<br />

These functions perform basic Trigonometric functions.<br />

sin returns the sine value of the parameter (measured in radians)<br />

cos returns the cosine value of the parameter (measured in radians)<br />

tan returns the tangent value of the parameter (measured in radians)<br />

asin returns the arc sine value in the range [-pi/2,+pi/2] radians<br />

acos returns the arc cosine value in the range[0,pi] radians<br />

atan returns the arc tangent value in the range [-pi/2,+pi/2] radians<br />

atan2 returns the arc tangent of y/x in the range [-pi,+pi] radians<br />

sinh returns the hyperbolic sine of x<br />

cosh returns the hyperbolic cosine of x<br />

tanh returns the hyperbolic tangent of x<br />

Note on error handling:<br />

If "errno.h" is included then the domain and range errors are stored in the errno<br />

variable. The user can check the errno to see if an error has occurred and print the<br />

error using the perror function.<br />

156

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

Saved successfully!

Ooh no, something went wrong!