Modify the epsilon parameter of the approxEqual() method

This commit is contained in:
Daniel Chappuis 2013-03-09 08:37:40 +01:00
parent bd0561acd9
commit 8107bbab8e

View File

@ -37,7 +37,7 @@ namespace reactphysics3d {
// function to test if two real numbers are (almost) equal
// We test if two numbers a and b are such that (a-b) are in [-EPSILON; EPSILON]
inline bool approxEqual(decimal a, decimal b, decimal epsilon = 1.0e-10) {
inline bool approxEqual(decimal a, decimal b, decimal epsilon = MACHINE_EPSILON) {
decimal difference = a - b;
return (difference < epsilon && difference > -epsilon);
}