03.08.2013 Views

Embedded Software and Motor Control Libraries for PXS20xx

Embedded Software and Motor Control Libraries for PXS20xx

Embedded Software and Motor Control Libraries for PXS20xx

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Function MLIB_Sub_FLT<br />

4.177.5 Re-entrancy<br />

The function is re-entrant.<br />

4.177.6 Code Example<br />

#include "mlib.h"<br />

tFloat fltIn1;<br />

tFloat fltIn2;<br />

tFloat fltOut;<br />

void main(void)<br />

{<br />

// first input = 50.5<br />

fltIn1 = 50.5<br />

}<br />

// second input = 25.25<br />

fltIn2 = 25.25;<br />

// output should be 25.25<br />

fltOut = MLIB_Sub_FLT(fltIn1,fltIn2);<br />

// output should be 25.25<br />

fltOut = MLIB_Sub (fltIn1,fltIn2,Define FLT);<br />

// ##############################################################<br />

// Available only if single precision floating point<br />

// implementation selected as default<br />

// ##############################################################<br />

// output should be 25.25<br />

fltOut = MLIB_Sub (fltIn1,fltIn2);<br />

The output of the function is defined by the following simple equation:<br />

Overflow is not detected.<br />

4.177.7 Re-entrancy<br />

The function is re-entrant.<br />

Equation MLIB_Sub_Eq1<br />

Note<br />

<strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> <strong>PXS20xx</strong>, Rev. 1.0<br />

668 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!