Compare(Value1: Double; Value2: Double): Integer;
Value1. The first compared real value.
Value2. The second compared real value.
The Compare method compares two real numbers without taking into account precision.
The method returns "-1" if Value1>Value2, "0" if Value1=Value2 and "-1" if Value1<Value2.
Sub Main;
Var
x1, x2: Double;
i: Integer;
Begin
x1 := Math.Rand;
x2 := Math.Rand;
i := Double.Compare(x1, x2);
End Sub Main;
After executing the example the "i" variable will contain the attribute of comparison two random real numbers.
See also: