fabs(float)

Gets the absolute value of a number.

float fabs(
    float fValue
);

Parameters

fValue

Float to retrieve the absolute value of.


Description

Returns the absolute (non-negative; numeric distance from the number 0) value of fValue.



Remarks

Useful when subtracting two numbers, without first having to find find out which is higher, when all you're interested in is the difference between the two.


Version

1.61

Example

void main()
{
//Both fFloat1 and fFloat2 will be 1.0
float fFloat1=fabs(3.0 - 2.0);
float fFloat2=fabs(2.0 - 3.0);
}

See Also

functions: abs
categories: Math Functions


 author: Charles Feduke, editor: Lilac Soul