Click or drag to resize

AbsReal4 Function

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

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION AbsReal4(
	r4Value AS REAL4
) AS REAL4
View Source

Parameters

r4Value
Type: Single
The 32-bit floating point number to evaluate.

Return Value

Type: Single
A positive number or 0.
Remarks
AbsReal4() is the same as Abs() except that it is strongly typed.  For more information, see Abs().
Examples
These examples show typical results from AbsReal4():
X#
LOCAL r4Num1 := 99.99 AS REAL4
LOCAL r4Num2 := 149.99 AS REAL4
? r4Num1 - r4Num2                                // -50.00
? AbsReal4(r4Num1 - r4Num2)                        //  50.00
? AbsReal4(r4Num2 - r4Num1)                        //  50.00
? AbsReal4(-12)                                        //  12
? AbsReal4(0)                                        //  0
See Also