Double

scala.math.Equiv$.Double$
object Double

Equivs for Doubles.

Attributes

Source
Equiv.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Double.type

Members list

Type members

Classlikes

object IeeeEquiv extends IeeeEquiv

Attributes

Companion
trait
Source
Equiv.scala
Supertypes
trait IeeeEquiv
trait Equiv[Double]
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
IeeeEquiv.type
trait IeeeEquiv extends Equiv[Double]

An equivalence for Doubles which is consistent with IEEE specifications.

An equivalence for Doubles which is consistent with IEEE specifications.

Because the behaviour of Doubles specified by IEEE is not consistent with behaviors required of an equivalence relation for NaN (it is not reflexive), there are two equivalences defined for Double: StrictEquiv, which is reflexive, and IeeeEquiv, which is consistent with IEEE spec and floating point operations defined in scala.math.

This equivalence may be preferable for numeric contexts.

Attributes

See also
Companion
object
Source
Equiv.scala
Supertypes
trait Equiv[Double]
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object IeeeEquiv.type
object StrictEquiv extends StrictEquiv

Attributes

Companion
trait
Source
Equiv.scala
Supertypes
trait StrictEquiv
trait Equiv[Double]
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
trait StrictEquiv extends Equiv[Double]

An equivalence for Doubles which is reflexive (treats all NaNs as equivalent), and treats -0.0 and 0.0 as not equivalent; it behaves the same as java.lang.Double.compare.

An equivalence for Doubles which is reflexive (treats all NaNs as equivalent), and treats -0.0 and 0.0 as not equivalent; it behaves the same as java.lang.Double.compare.

Because the behaviour of Doubles specified by IEEE is not consistent with behaviors required of an equivalence relation for NaN (it is not reflexive), there are two equivalences defined for Double: StrictEquiv, which is reflexive, and IeeeEquiv, which is consistent with IEEE spec and floating point operations defined in scala.math.

This equivalence may be preferable for collections.

Attributes

See also
Companion
object
Source
Equiv.scala
Supertypes
trait Equiv[Double]
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object DeprecatedDoubleEquiv.type
object StrictEquiv.type