Small changes, cause you forgot function call ABS(a - b)
Code:
const
//A treshold for float comparison
EPSILON = 1e-5;
implementation
function Equals(const a, b: Single): Boolean;
begin
Result := (abs(a - b) < EPSILON);
end;
Thomas
Argh.. that's indeed a stupid mistake. Thanks for the heads up.
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
Bookmarks