Scalactic User Guide
The Explicitly DSL
Or and Every
For example, the
result === 10.0 +- 0.5
Here are some examples in the Scala REPL:
scala> import org.scalactic._ import org.scalactic._ scala> import TripleEquals._ import TripleEquals._ scala> import Tolerance._ import Tolerance._ scala> val result = 2.000001 result: Double = 2.000001 scala> result === 2.0 +- .001 res0: Boolean = true scala> result === 2.0 +- .000000001 res1: Boolean = false
Next, learn about Normalization.
Scalactic is brought to you by Bill Venners, with
contributions from several other folks. It is sponsored by
ScalaTest is free, open-source software released under the Apache 2.0 license.
Copyright © 2009-2017 Artima, Inc. All Rights Reserved.