Anonymous user
Approximate equality: Difference between revisions
→{{header|Scala}}
Line 1,012:
3.14159265358979323846 ≈ 3.14159265358979324</pre>
=={{header|Scala}}==
{{Out}}Best seen running in your browser by [https://scastie.scala-lang.org/
<lang Scala>object Approximate extends App {
val (ok, notOk, ε) = ("👌", "❌", 1e-
private def approxEquals(value: Double, other: Double, epsilon:
scala.math.abs(value - other) < epsilon
|