Returns True if X1 and X2 are within a "small" value of each other.Unit
QESBPCSMath
Declaration
Function SameFloat(const X1, X2: Extended): Boolean;
Description
For Values with lots of significant figures, ESBPrecision may need to be changed to a smaller value - ESBDoublePrecision for Doubles and ESBSinglePrecision for Singles.
X1 | First Float to process. |
X2 | Second Float to process. |
Returns
abs (X1 - X2) < ESBTolerance.
Category
Comparison between Integers and Floats
Implementation
function SameFloat (const X1, X2: Extended): Boolean;
begin
Result := abs (X1 - X2) <= ExtendedPrecision (X1, X2);
End; |
Declaration
Function SameFloat(const X1, X2: Double): Boolean;Implementation
function SameFloat (const X1, X2: Double): Boolean;
begin
Result := abs (X1 - X2) <= DoublePrecision (X1, X2);
End; |
Declaration
Function SameFloat(const X1, X2: Single): Boolean;Implementation
function SameFloat (const X1, X2: Single): Boolean;
begin
Result := abs (X1 - X2) <= SinglePrecision (X1, X2);
End; |
HTML generated by Time2HELP
|
http://www.time2help.com