Provides Equality and Equivalence instances for Numeric types that
compare for equality with a given tolerance.
Here's an example:
scala> import org.scalactic._ import org.scalactic._ scala> import TripleEquals._ import TripleEquals._ scala> 2.001 === 2.0 res0: Boolean = false scala> implicit val doubleEquality = TolerantNumerics.tolerantDoubleEquality(0.01) doubleEquality: org.scalactic.Equality[Double] = org.scalactic.TolerantNumerics$$anon$1@16c2bd13 scala> 2.001 === 2.0 res1: Boolean = true
- Companion:
- object
- Source:
- TolerantNumerics.scala
Value members
Concrete methods
Provides an Equality instance for Bytes that
compares for equality with the passed tolerance.
Provides an Equality instance for Bytes that
compares for equality with the passed tolerance.
- Value parameters:
- tolerance
the tolerance with which the returned
Equalitywill compareBytes.
- Returns:
an
Equalitythat comparesBytes using the passed tolerance.- Source:
- TolerantNumerics.scala
Provides an Equality instance for Doubles that
compares for equality with the passed tolerance.
Provides an Equality instance for Doubles that
compares for equality with the passed tolerance.
- Value parameters:
- tolerance
the tolerance with which the returned
Equalitywill compareDoubles.
- Returns:
an
Equalitythat comparesDoubles using the passed tolerance.- Source:
- TolerantNumerics.scala
Provides an Equivalence[N] instance for any type for which a Numeric[N] is available that
compares Ns for equality with the passed tolerance.
Provides an Equivalence[N] instance for any type for which a Numeric[N] is available that
compares Ns for equality with the passed tolerance.
- Value parameters:
- tolerance
the tolerance with which the returned
Equalitywill compareNumerics.
- Returns:
an
Equivalencethat comparesNumerics using the passed tolerance.- Source:
- TolerantNumerics.scala
Provides an Equality instance for Floats that
compares for equality with the passed tolerance.
Provides an Equality instance for Floats that
compares for equality with the passed tolerance.
- Value parameters:
- tolerance
the tolerance with which the returned
Equalitywill compareFloats.
- Returns:
an
Equalitythat comparesFloats using the passed tolerance.- Source:
- TolerantNumerics.scala
Provides an Equality instance for Ints that
compares for equality with the passed tolerance.
Provides an Equality instance for Ints that
compares for equality with the passed tolerance.
- Value parameters:
- tolerance
the tolerance with which the returned
Equalitywill compareInts.
- Returns:
an
Equalitythat comparesInts using the passed tolerance.- Source:
- TolerantNumerics.scala
Provides an Equality instance for Longs that
compares for equality with the passed tolerance.
Provides an Equality instance for Longs that
compares for equality with the passed tolerance.
- Value parameters:
- tolerance
the tolerance with which the returned
Equalitywill compareLongs.
- Returns:
an
Equalitythat comparesLongs using the passed tolerance.- Source:
- TolerantNumerics.scala
Provides an Equality instance for Shorts that
compares for equality with the passed tolerance.
Provides an Equality instance for Shorts that
compares for equality with the passed tolerance.
- Value parameters:
- tolerance
the tolerance with which the returned
Equalitywill compareShorts.
- Returns:
an
Equalitythat comparesShorts using the passed tolerance.- Source:
- TolerantNumerics.scala