17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Built-in Functions<br />

frexp( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

result=frexp (value, &exp);<br />

value is a float<br />

exp is a signed int.<br />

result is a float<br />

The frexp function breaks a floating point number into a normalized fraction<br />

and an integral power of 2. It stores the integer in the signed int object<br />

exp. The result is in the interval [1/2 to1) or zero, such that value is result<br />

times 2 raised to power exp. If value is zero then both parts are zero.<br />

All devices.<br />

#INCLUDE <br />

float result;<br />

signed int exp;<br />

result=frexp(.5,&exp);<br />

// result is .5 and exp is 0<br />

None<br />

ldexp(), exp(), log(), log10(), modf()<br />

scanf( )<br />

printf( )<br />

Syntax:<br />

scanf(cstring);<br />

scanf(cstring, values...)<br />

fscanf(stream, cstring, values...)<br />

Parameters: cstring is a constant string.<br />

values is a list of variables separated by commas.<br />

stream is a stream identifier.<br />

Returns:<br />

Function:<br />

0 if a failure occurred, otherwise it returns the number of conversion specifiers<br />

that were read in, plus the number of constant strings read in.<br />

Reads in a string of characters from the standard RS-232 pins and formats the<br />

185

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

Saved successfully!

Ooh no, something went wrong!