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.

Example Files:<br />

Also See:<br />

None<br />

getc(), get_string in input.c<br />

floor( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

result = floor (value)<br />

value is a float<br />

result is a float<br />

Computes the greatest integer value not greater than the argument. Floor<br />

(12.67) is 12.00.<br />

All devices.<br />

#INCLUDE <br />

// Find the fractional part of a value<br />

frac = value - floor(value);<br />

None<br />

ceil()<br />

fmod( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

result= fmod (val1, val2)<br />

val1 is a float<br />

val2 is a float<br />

result is a float<br />

Returns the floating point remainder of val1/val2. Returns the value val1 - i*val2<br />

for some integer “i” such that, if val2 is nonzero, the result has the same sign<br />

as val1 and magnitude less than the magnitude of val2.<br />

180

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

Saved successfully!

Ooh no, something went wrong!