floatingDifference()
The vgLib.floatingDifference() system function converts two numbers to double-precision floating point type, subtracts the second from the first, and returns the difference.
vgLib.floatingDifference() is one of a number of functions maintained for compatibility with earlier versions. New code can use standard EGL operators for these purposes.
HEX fields can be used as both the input and the result fields. In this case, HEX(8) corresponds to SMALLFLOAT and HEX(16) corresponds to FLOAT.
Syntax
vgLib.floatingDifference(
operand1 FLOAT in,
operand2 FLOAT in)
returns (result FLOAT)
- operand1
- Any numeric value that is assignment compatible with FLOAT. The value is converted to double-precision floating point type before the difference is calculated.
- operand2
- Any numeric variable that is assignment compatible with FLOAT.
- result
- A FLOAT value.
Example
The following example shows the vgLib.floatingDifference() function:
myVar01, myVar02, result FLOAT;
myVar01 = 19;
myVar02 = 7;
result = vgLib.floatingDifference(myVar01,myVar02);
// result = 12.0