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 />

Also See:<br />

memcpy()<br />

modf( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

result= modf (value, & integral)<br />

value is a float<br />

integral is a float<br />

result is a float<br />

The modf function breaks the argument value into integral and fractional<br />

parts, each of which has the same sign as the argument. It stores the integral<br />

part as a float in the object integral.<br />

All devices<br />

#INCLUDE <br />

float result, integral;<br />

result=modf(123.987,&integral);<br />

// result is .987 and integral is 123.0000<br />

None<br />

None<br />

_mul( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

prod=_mul(val1, val2);<br />

val1 and val2 are both 8-bit<br />

or 16-bit integers<br />

A 16-bit integer if both<br />

parameters are 8-bit<br />

integers, or a 32-bit integer if<br />

both parameters are 16-bit<br />

integers.<br />

Performs an optimized<br />

multiplication. By accepting a<br />

223

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

Saved successfully!

Ooh no, something went wrong!