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.

Function GFLIB_Sign_FLT<br />

4.78 Function GFLIB_Sign_FLT<br />

This function returns the signum of input value.<br />

4.78.1 Declaration<br />

tFloat GFLIB_Sign_FLT(tFloat fltIn);<br />

4.78.2 Arguments<br />

Table 4-99. GFLIB_Sign_FLT<br />

arguments<br />

Type Name Direction Description<br />

tFloat fltIn input Input argument.<br />

4.78.3 Return<br />

The function returns the sign of the input argument.<br />

4.78.4 Description<br />

The GFLIB_Sign function calculates the sign of the input argument. The function return<br />

value is computed as follows. If the input value is negative, then the return value will be<br />

set to "-1", if the input value is zero, then the function returns "0", otherwise if the input<br />

value is greater than zero, the return value will be "1".<br />

In mathematical terms, the function works according to the equation below:<br />

where:<br />

Equation GFLIB_Sign_Eq1<br />

• y out is the return value<br />

• x in is the input value provided as the fltIn parameter<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 />

398 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!