Click or drag to resize

AbsFloat Function

X#
Return the absolute value of a strongly typed numeric expression, regardless of its sign.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION AbsFloat(
	fValue AS FLOAT
) AS FLOAT
Request Example View Source

Parameters

fValue
Type: Float
The floating point number to evaluate.

Return Value

Type: Float
A positive number or 0.
Remarks
AbsFloat() is the same as Abs() except that it is strongly typed.
For more information, see Abs().
Examples
These examples show typical results from AbsFloat():
X#
1LOCAL fNum1 := 99.99 AS FLOAT
2LOCAL fNum2 := 149.99 AS FLOAT
3? fNum1 - fNum2                // -50.00
4? AbsFloat(fNum1 - fNum2)        //  50.00
5? AbsFloat(fNum2 - fNum1)        //  50.00
6? AbsFloat(-12)                //  12
7? AbsFloat(0)                //  0
See Also