Check if two numbers are approximately equal with a maximum abolute error.
Any number
Maximum absolute error
True if a is approximately b
a
b
const b1 = SMath.approx(1 / 3, 0.33, 1e-6), // false b2 = SMath.approx(1 / 3, 0.33, 1e-2); // true Copy
const b1 = SMath.approx(1 / 3, 0.33, 1e-6), // false b2 = SMath.approx(1 / 3, 0.33, 1e-2); // true
Check if two numbers are approximately equal with a maximum abolute error.