Why does Scala-lang not just provide approximately equals comparisions?

== has a contract (reflexivity, symmetricity, transitivity). “approximately equals” is not transitive. If a is approximately equal to b (math.abs(a - b) < e) and b is approximately equal to c (math.abs(b - c) < e) then a can be not approximately equal to c (math.abs(a - c) can be >= e ).

1 Like