Packages

c

cats.kernel.instances

FloatOrder

class FloatOrder extends Order[Float] with Hash[Float]

Due to the way floating-point equality works, this instance is not lawful under equality, but is correct when taken as an approximation of an exact value.

If you would prefer an absolutely lawful fractional value, you'll need to investigate rational numbers or more exotic types.

Source
FloatInstances.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FloatOrder
  2. Hash
  3. Order
  4. PartialOrder
  5. Eq
  6. Serializable
  7. Serializable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FloatOrder()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. def compare(x: Float, y: Float): Int

    Result of comparing x with y.

    Result of comparing x with y. Returns an Int whose sign is: - negative iff x < y - zero iff x = y - positive iff x > y

    Definition Classes
    FloatOrderOrder
  7. def comparison(x: Float, y: Float): Comparison

    Like compare, but returns a cats.kernel.Comparison instead of an Int.

    Like compare, but returns a cats.kernel.Comparison instead of an Int. Has the benefit of being able to pattern match on, but not as performant.

    Definition Classes
    Order
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def eqv(x: Float, y: Float): Boolean

    Returns true if x = y, false otherwise.

    Returns true if x = y, false otherwise.

    Definition Classes
    FloatOrderOrderPartialOrderEq
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def gt(x: Float, y: Float): Boolean

    Returns true if x > y, false otherwise.

    Returns true if x > y, false otherwise.

    Definition Classes
    FloatOrderOrderPartialOrder
  14. def gteqv(x: Float, y: Float): Boolean

    Returns true if x >= y, false otherwise.

    Returns true if x >= y, false otherwise.

    Definition Classes
    FloatOrderOrderPartialOrder
  15. def hash(x: Float): Int

    Returns the hash code of the given object under this hashing scheme.

    Returns the hash code of the given object under this hashing scheme.

    Definition Classes
    FloatOrderHash
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def lt(x: Float, y: Float): Boolean

    Returns true if x < y, false otherwise.

    Returns true if x < y, false otherwise.

    Definition Classes
    FloatOrderOrderPartialOrder
  19. def lteqv(x: Float, y: Float): Boolean

    Returns true if x <= y, false otherwise.

    Returns true if x <= y, false otherwise.

    Definition Classes
    FloatOrderOrderPartialOrder
  20. def max(x: Float, y: Float): Float

    If x > y, return x, else return y.

    If x > y, return x, else return y.

    Definition Classes
    FloatOrderOrder
  21. def min(x: Float, y: Float): Float

    If x < y, return x, else return y.

    If x < y, return x, else return y.

    Definition Classes
    FloatOrderOrder
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. def neqv(x: Float, y: Float): Boolean

    Returns true if x != y, false otherwise.

    Returns true if x != y, false otherwise.

    Note: this default implementation provided by Order is the same as the one defined in Eq, but for purposes of binary compatibility, the override in Order has not yet been removed. See this discussion.

    Definition Classes
    FloatOrderOrderEq
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def partialCompare(x: Float, y: Float): Double

    Result of comparing x with y.

    Result of comparing x with y. Returns NaN if operands are not comparable. If operands are comparable, returns a Double whose sign is: - negative iff x < y - zero iff x = y - positive iff x > y

    Definition Classes
    OrderPartialOrder
  27. def partialComparison(x: Float, y: Float): Option[Comparison]

    Like partialCompare, but returns a cats.kernel.Comparison instead of an Double.

    Like partialCompare, but returns a cats.kernel.Comparison instead of an Double. Has the benefit of being able to pattern match on, but not as performant.

    Definition Classes
    PartialOrder
  28. def pmax(x: Float, y: Float): Option[Float]

    Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

    Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

    Definition Classes
    PartialOrder
  29. def pmin(x: Float, y: Float): Option[Float]

    Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

    Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

    Definition Classes
    PartialOrder
  30. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  31. def toOrdering: Ordering[Float]

    Convert a Order[A] to a scala.math.Ordering[A] instance.

    Convert a Order[A] to a scala.math.Ordering[A] instance.

    Definition Classes
    Order
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. def tryCompare(x: Float, y: Float): Option[Int]

    Result of comparing x with y.

    Result of comparing x with y. Returns None if operands are not comparable. If operands are comparable, returns Some[Int] where the Int sign is: - negative iff x < y - zero iff x = y - positive iff x > y

    Definition Classes
    PartialOrder
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Hash[Float]

Inherited from Order[Float]

Inherited from PartialOrder[Float]

Inherited from Eq[Float]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped