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.

Requires:<br />

#INCLUDE <br />

Examples:<br />

distance = sqrt( pow((x1-x2),2)+pow((y1-y2),2) );<br />

Example Files:<br />

Also See:<br />

None<br />

None<br />

srand( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

srand(n)<br />

n is the seed for a new sequence of pseudo-random numbers to be returned<br />

by subsequent calls to rand.<br />

No value.<br />

The srand() function uses the argument as a seed for a new sequence of<br />

pseudo-random numbers to be returned by subsequent calls to rand. If<br />

srand() is then called with same seed value, the sequence of random<br />

numbers shall be repeated. If rand is called before any call to srand() have<br />

been made, the same sequence shall be generated as when srand() is first<br />

called with a seed value of 1.<br />

All devices.<br />

#INCLUDE <br />

srand(10);<br />

I=rand();<br />

None<br />

rand()<br />

strtod( )<br />

Syntax:<br />

Parameters:<br />

result=strtod(nptr,& endptr)<br />

nptr and endptr are strings<br />

320

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

Saved successfully!

Ooh no, something went wrong!