NumberOrdering

object NumberOrdering extends InlinedOrdering[Number]

An InlineOrdering instance for Number

An InlineOrdering instance for Number

trait InlinedOrdering[Number]
class Object
trait Matchable
class Any

Value members

Concrete methods

inline override def compare(inline x: Number, inline y: Number): Int
Definition Classes
InlinedOrdering

Inherited methods

inline def compareAlias(inline x: Number, inline y: Number): Int
Inherited from
InlinedOrdering
inline def equiv(inline x: Number, inline y: Number): Boolean

Return true if x == y in the ordering.

Return true if x == y in the ordering.

Inherited from
InlinedOrdering
inline def gt(inline x: Number, inline y: Number): Boolean

Return true if x > y in the ordering.

Return true if x > y in the ordering.

Inherited from
InlinedOrdering
inline def gteq(inline x: Number, inline y: Number): Boolean

Return true if x >= y in the ordering.

Return true if x >= y in the ordering.

Inherited from
InlinedOrdering
inline def lt(inline x: Number, inline y: Number): Boolean

Return true if x < y in the ordering.

Return true if x < y in the ordering.

Inherited from
InlinedOrdering
inline def lteq(inline x: Number, inline y: Number): Boolean

Return true if x <= y in the ordering.

Return true if x <= y in the ordering.

Inherited from
InlinedOrdering
inline def max[U <: Number](inline x: U, inline y: U): U

Return x if x >= y, otherwise y.

Return x if x >= y, otherwise y.

Inherited from
InlinedOrdering
inline def min[U <: Number](inline x: U, inline y: U): U

Return x if x <= y, otherwise y.

Return x if x <= y, otherwise y.

Inherited from
InlinedOrdering
inline def on[U](inline f: U => Number): Ordering[U]

Given f, a function from U into T, creates an Ordering[U] whose compare function is equivalent to:

Given f, a function from U into T, creates an Ordering[U] whose compare function is equivalent to:

def compare(x:U, y:U) = Ordering[T].compare(f(x), f(y))
Inherited from
InlinedOrdering
inline def orElse(inline other: Ordering[Number]): Ordering[Number]

Creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else the result of others compare function.

Creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else the result of others compare function.

Value Params
other

an Ordering to use if this Ordering returns zero

Example
case class Pair(a: Int, b: Int)
val pairOrdering = Ordering.by[Pair, Int](_.a)
                          .orElse(Ordering.by[Pair, Int](_.b))
Inherited from
InlinedOrdering
inline def orElseBy[S](inline f: Number => S)(inline ord: Ordering[S]): Ordering[Number]

Given f, a function from T into S, creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else a result equivalent to:

Given f, a function from T into S, creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else a result equivalent to:

Ordering[S].compare(f(x), f(y))

This function is equivalent to passing the result of Ordering.by(f) to orElse.

Example
case class Pair(a: Int, b: Int)
val pairOrdering = Ordering.by[Pair, Int](_.a)
                          .orElseBy[Int](_.b)
Inherited from
InlinedOrdering
inline def tryCompare(inline x: Number, inline y: Number): Some[Int]

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

Inherited from
InlinedOrdering