Packages

final class IdealRat extends Ordered[IdealRat]

Naive implementation of rational numbers

Linear Supertypes
Ordered[IdealRat], Comparable[IdealRat], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IdealRat
  2. Ordered
  3. Comparable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def *(that: IdealRat): IdealRat

    Multiplication of IdealRat

  4. def +(that: IdealRat): IdealRat

    Addition of IdealRat

  5. def -(that: IdealRat): IdealRat

    Subtraction of IdealRat

  6. def /(that: IdealRat): IdealRat

    Division of IdealRat.

    Division of IdealRat. We use euclidian division with remainder, i.e., the property this == (this / that) * that + (this % that) holds, and this % that >= 0 and this % that < that.abs.

    TODO: make this more efficient

  7. def <(that: IdealRat): Boolean
    Definition Classes
    Ordered
  8. def <=(that: IdealRat): Boolean
    Definition Classes
    Ordered
  9. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def >(that: IdealRat): Boolean
    Definition Classes
    Ordered
  11. def >=(that: IdealRat): Boolean
    Definition Classes
    Ordered
  12. def abs: IdealRat

    Returns the absolute value of this IdealRat

  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  15. def compare(that: IdealRat): Int

    Compares this IdealRat with the specified IdealRat

    Compares this IdealRat with the specified IdealRat

    Definition Classes
    IdealRat → Ordered
  16. def compareTo(that: IdealRat): Int
    Definition Classes
    Ordered → Comparable
  17. val denom: IdealInt
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(that: IdealRat): Boolean

    Compares this IdealRat with the specified IdealRat for equality.

  20. def equals(that: Any): Boolean

    Compares this IdealRat with the specified value for equality.

    Compares this IdealRat with the specified value for equality.

    Definition Classes
    IdealRat → AnyRef → Any
  21. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  22. def hashCode(): Int

    Returns the hash code for this IdealRat.

    Returns the hash code for this IdealRat.

    Definition Classes
    IdealRat → AnyRef → Any
  23. def intValue: Int
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. def isMinusOne: Boolean

    Returns true iff this IdealRat is -one

  26. def isOne: Boolean

    Returns true iff this IdealRat is one

  27. def isUnit: Boolean

    Returns true iff this IdealRat is one or -one

  28. def isZero: Boolean

    Returns true iff this IdealRat is zero

  29. def longValue: Long
  30. def max(that: IdealRat): IdealRat

    Returns the maximum of this and that

  31. def min(that: IdealRat): IdealRat

    Returns the minimum of this and that

  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  35. val num: IdealInt
  36. def signum: Int

    Returns the sign of this IdealRat, i.e.

    Returns the sign of this IdealRat, i.e. -1 if it is less than 0, +1 if it is greater than 0 0 if it is equal to 0

  37. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  38. def toString(): String

    Returns the String representation of this IdealRat.

    Returns the String representation of this IdealRat.

    Definition Classes
    IdealRat → AnyRef → Any
  39. def unary_-: IdealRat

    Returns a IdealRat whose value is the negation of this IdealRat

  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Ordered[IdealRat]

Inherited from Comparable[IdealRat]

Inherited from AnyRef

Inherited from Any

Ungrouped