Packages

object Double

Orderings for Doubles.

Source
Ordering.scala
Linear Supertypes
Content Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Double
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait IeeeOrdering extends Ordering[Double]

    An ordering for Doubles which is consistent with IEEE specifications whenever possible.

    An ordering for Doubles which is consistent with IEEE specifications whenever possible.

    • lt, lteq, equiv, gteq and gt are consistent with primitive comparison operations for Doubles, and return false when called with NaN.
    • min and max are consistent with math.min and math.max, and return NaN when called with NaN as either argument.
    • compare behaves the same as java.lang.Double.compare().

    Because the behaviour of Doubles specified by IEEE is not consistent with a total ordering when dealing with NaN, there are two orderings defined for Double: TotalOrdering, which is consistent with a total ordering, and IeeeOrdering, which is consistent as much as possible with IEEE spec and floating point operations defined in scala.math.

    This ordering may be preferable for numeric contexts.

    See also

    TotalOrdering

  2. trait TotalOrdering extends Ordering[Double]

    An ordering for Doubles which is a fully consistent total ordering, and treats NaN as larger than all other Double values; it behaves the same as java.lang.Double.compare().

    An ordering for Doubles which is a fully consistent total ordering, and treats NaN as larger than all other Double values; it behaves the same as java.lang.Double.compare().

    Because the behaviour of Doubles specified by IEEE is not consistent with a total ordering when dealing with NaN, there are two orderings defined for Double: TotalOrdering, which is consistent with a total ordering, and IeeeOrdering, which is consistent as much as possible with IEEE spec and floating point operations defined in scala.math.

    This ordering may be preferable for sorting collections.

    See also

    IeeeOrdering

Value Members

  1. implicit object IeeeOrdering extends IeeeOrdering
  2. implicit object TotalOrdering extends TotalOrdering