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.

Figure 4-39. real sqrt(x) vs. GFLIB_Sqrt(fltIn)<br />

Note<br />

Input argument is a single precision floating point number<br />

limited to the range [0, 2 128 ), if not within this range the<br />

computed value is undefined.<br />

4.84.5 Re-entrancy<br />

The function is re-entrant.<br />

4.84.6 Code Example<br />

#include "gflib.h"<br />

tFloat fltIn;<br />

tFloat fltOut;<br />

void main(void)<br />

{<br />

// input value = 0.5<br />

fltIn = 0.5;<br />

// output should be 0.70710678<br />

fltOut = GFLIB_Sqrt_FLT (fltIn);<br />

// output should be 0.70710678<br />

fltOut = GFLIB_Sqrt (fltIn,Define FLT);<br />

Chapter 4 API References<br />

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

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

// implementation selected as default<br />

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

Freescale Semiconductor, Inc. 419

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

Saved successfully!

Ooh no, something went wrong!