Click or drag to resize

AbsReal4 Function

X#
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.19
Syntax
 FUNCTION AbsReal4(
	r4Value AS REAL4
) AS REAL4
Request Example 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#
1LOCAL r4Num1 := 99.99 AS REAL4
2LOCAL r4Num2 := 149.99 AS REAL4
3? r4Num1 - r4Num2                // -50.00
4? AbsReal4(r4Num1 - r4Num2)            //  50.00
5? AbsReal4(r4Num2 - r4Num1)            //  50.00
6? AbsReal4(-12)                    //  12
7? AbsReal4(0)                    //  0
See Also