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.

Built-in Functions<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Result is a floating point number<br />

Converts the string passed to the function into a floating<br />

point representation. If the result cannot be represented,<br />

the behavior is undefined. This function also handles E<br />

format numbers<br />

All devices<br />

#INCLUDE <br />

Examples: char string [10];<br />

float32 x;<br />

strcpy (string, "12E3");<br />

x = atoe(string);<br />

// x is now 12000.00<br />

Example<br />

Files:<br />

Also See:<br />

None<br />

atoi(), atol(), atoi32(), atof(), printf()<br />

atof( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

result = atof (string)<br />

string is a pointer to a null terminated string of characters.<br />

Result is a floating point number<br />

Converts the string passed to the function into a floating point<br />

representation. If the result cannot be represented, the behavior is<br />

undefined.<br />

All devices<br />

#INCLUDE <br />

Examples:<br />

char string [10];<br />

float x;<br />

strcpy (string, "123.456");<br />

x = atof(string);<br />

// x is now 123.456<br />

Example<br />

Files:<br />

Also See:<br />

ex_tank.c<br />

atoi(), atol(), atoi32(), printf()<br />

159

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

Saved successfully!

Ooh no, something went wrong!