Packages

sealed abstract class Rational extends ScalaNumber with ScalaNumericConversions with Ordered[Rational]

Self Type
Rational
Source
Rational.scala
Linear Supertypes
Ordered[Rational], Comparable[Rational], ScalaNumericConversions, ScalaNumericAnyConversions, ScalaNumber, java.lang.Number, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Rational
  2. Ordered
  3. Comparable
  4. ScalaNumericConversions
  5. ScalaNumericAnyConversions
  6. ScalaNumber
  7. Number
  8. Serializable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def *(rhs: Rational): Rational
  2. abstract def +(rhs: Rational): Rational
  3. abstract def -(rhs: Rational): Rational
  4. abstract def /(rhs: Rational): Rational
  5. abstract def ceil: Rational
  6. abstract def compare(that: Rational): Int
    Definition Classes
    Ordered
  7. abstract def compareToOne: Int
  8. abstract def denominator: SafeLong
  9. abstract def denominatorAbsIsValidLong: Boolean
    Attributes
    protected
  10. abstract def denominatorAsLong: Long
  11. abstract def denominatorIsValidLong: Boolean
  12. abstract def doubleValue(): Double
    Definition Classes
    ScalaNumericAnyConversions
  13. abstract def floor: Rational
  14. abstract def isOne: Boolean
  15. abstract def isValidLong: Boolean
  16. abstract def isWhole(): Boolean
    Definition Classes
    Rational → ScalaNumericAnyConversions → ScalaNumber
  17. abstract def isZero: Boolean
  18. abstract def numerator: SafeLong
  19. abstract def numeratorAbsIsValidLong: Boolean
    Attributes
    protected
  20. abstract def numeratorAsLong: Long
  21. abstract def numeratorIsValidLong: Boolean
  22. abstract def pow(exp: Int): Rational
  23. abstract def reciprocal: Rational
  24. abstract def round: Rational
  25. abstract def signum: Int
  26. abstract def toSafeLong: SafeLong
  27. abstract def unary_-(): Rational

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def %(rhs: Rational): Rational
  4. def <(that: Rational): Boolean
    Definition Classes
    Ordered
  5. def <=(that: Rational): Boolean
    Definition Classes
    Ordered
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def >(that: Rational): Boolean
    Definition Classes
    Ordered
  8. def >=(that: Rational): Boolean
    Definition Classes
    Ordered
  9. def abs: Rational
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def byteValue(): Byte
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  12. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate() @throws( ... )
  13. def compareTo(that: Rational): Int
    Definition Classes
    Ordered → Comparable
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(that: Any): Boolean
    Definition Classes
    Rational → AnyRef → Any
  16. def floatValue(): Float
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  17. def gcd(rhs: Rational): Rational
  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def intValue(): Int
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  21. def inverse: Rational
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isValidByte: Boolean
    Definition Classes
    ScalaNumericAnyConversions
  24. def isValidChar: Boolean
    Definition Classes
    ScalaNumericAnyConversions
  25. def isValidInt: Boolean
    Definition Classes
    ScalaNumericAnyConversions
  26. def isValidShort: Boolean
    Definition Classes
    ScalaNumericAnyConversions
  27. def lcm(rhs: Rational): Rational
  28. def limitDenominatorTo(limit: SafeLong): Rational

    Finds the closest Rational to this Rational whose denominator is no larger than limit.

    Finds the closest Rational to this Rational whose denominator is no larger than limit.

    See http://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree#Mediants_and_binary_search

  29. def limitTo(max: SafeLong): Rational

    Returns a Rational whose denominator and numerator are no larger than max and whose value is close to the original.

    Returns a Rational whose denominator and numerator are no larger than max and whose value is close to the original. This applies, even if, for example, this Rational is greater than max. In that case, Rational(max, 1) is returned.

    max

    A positive integer.

  30. def limitToInt: Rational

    Returns a Rational whose numerator and denominator both fit in an Int.

  31. def limitToLong: Rational

    Returns a Rational whose numerator and denominator both fit in a Long.

  32. def longValue(): Long
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  33. def max(rhs: Rational): Rational
  34. def min(rhs: Rational): Rational
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  38. def roundTo(denom: SafeLong): Rational
  39. def shortValue(): Short
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  40. def sign: Sign
  41. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  42. def tmod(rhs: Rational): Rational
  43. def toAlgebraic: Algebraic
  44. def toBigDecimal(mc: MathContext): BigDecimal
  45. def toBigDecimal(scale: Int, mode: RoundingMode): BigDecimal
  46. final def toBigInt: BigInt
  47. def toByte: Byte
    Definition Classes
    ScalaNumericAnyConversions
  48. def toChar: Char
    Definition Classes
    ScalaNumericAnyConversions
  49. def toDouble: Double
    Definition Classes
    ScalaNumericAnyConversions
  50. def toFloat: Float
    Definition Classes
    ScalaNumericAnyConversions
  51. def toInt: Int
    Definition Classes
    ScalaNumericAnyConversions
  52. def toLong: Long
    Definition Classes
    ScalaNumericAnyConversions
  53. def toReal: Real
  54. def toShort: Short
    Definition Classes
    ScalaNumericAnyConversions
  55. def toString(): String
    Definition Classes
    AnyRef → Any
  56. def tquot(rhs: Rational): Rational
  57. def tquotmod(rhs: Rational): (Rational, Rational)
  58. def underlying(): AnyRef
    Definition Classes
    Rational → ScalaNumericConversions → ScalaNumericAnyConversions → ScalaNumber
  59. def unifiedPrimitiveEquals(x: Any): Boolean
    Attributes
    protected
    Definition Classes
    ScalaNumericAnyConversions
  60. def unifiedPrimitiveHashcode(): Int
    Attributes
    protected
    Definition Classes
    ScalaNumericAnyConversions
  61. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  63. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

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

    (Since version ) see corresponding Javadoc for more information.

Inherited from Ordered[Rational]

Inherited from Comparable[Rational]

Inherited from ScalaNumericConversions

Inherited from ScalaNumericAnyConversions

Inherited from ScalaNumber

Inherited from java.lang.Number

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped