03.08.2013 Views

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.152.4 Description<br />

Single precision floating point multiplication of two input values. The input values as<br />

well as output value is considered as single precision floating point data type. The output<br />

saturation is not implemented in this function, thus in case the multiplication of input<br />

values is outside the (-2 128 , 2 128 ) interval, the output value will overflow without any<br />

detection.<br />

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

Equation MLIB_Mul_Eq1<br />

Single precision floating point multiplication of two input values. The input values as<br />

well as output value is considered as single precision floating point data type. The output<br />

saturation is not implemented in this function, thus in case the multiplication of input<br />

values is outside the (-2 128 , 2 128 ) interval, the output value will overflow without any<br />

detection.<br />

Overflow is not detected.<br />

4.152.5 Re-entrancy<br />

The function is re-entrant.<br />

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

// second input = 25.25<br />

fltIn2 = 25.25;<br />

Note<br />

// output should be 1275.125<br />

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

// output should be 1275.125<br />

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

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 621

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

Saved successfully!

Ooh no, something went wrong!