Tolerance

trait Tolerance

Trait containing an implicit conversion that adds a +- method to Numeric types, which enables spreads to be expressed in terms of a pivot and tolerance.

For example, the TripleEquals trait (and its type-checking siblings TypeCheckedTripleEquals and ConversionCheckedTripleEquals) enable you to write:

a === (1.0 +- 0.1)
Companion:
object
Source:
Tolerance.scala
class Object
trait Matchable
class Any
object Tolerance.type

Type members

Classlikes

final class PlusOrMinusWrapper[T](pivot: T)(implicit evidence$1: Numeric[T])

Wrapper class with a +- method that, given a Numeric argument, returns a Spread.

Wrapper class with a +- method that, given a Numeric argument, returns a Spread.

Value parameters:
tolerance

the tolerance with which to create (and return) a Spread

Source:
Tolerance.scala

Implicits

Implicits

implicit def convertNumericToPlusOrMinusWrapper[T : Numeric](pivot: T): PlusOrMinusWrapper[T]

Implicitly converts an object of a Numeric type to a PlusOrMinusWrapper, to enable a +- method to be invoked on that object.

Implicitly converts an object of a Numeric type to a PlusOrMinusWrapper, to enable a +- method to be invoked on that object.

Source:
Tolerance.scala