Float

object Float

Equivs for Floats.

Source
Equiv.scala
class Object
trait Matchable
class Any

Type members

Classlikes

object IeeeEquiv extends IeeeEquiv
Companion
class
Source
Equiv.scala
trait IeeeEquiv extends Equiv[Float]

An equivalence for Floats which is consistent with IEEE specifications.

An equivalence for Floats which is consistent with IEEE specifications.

Because the behaviour of Floats 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 Float: 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.

See also
Companion
object
Source
Equiv.scala
object StrictEquiv extends StrictEquiv
Companion
class
Source
Equiv.scala
trait StrictEquiv extends Equiv[Float]

An equivalence for Floats 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.Float.compare.

An equivalence for Floats 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.Float.compare.

Because the behaviour of Floats 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 Float: 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.

See also
Companion
object
Source
Equiv.scala