Class/Object

spire.math

Rational

Related Docs: object Rational | package math

Permalink

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

Self Type
Rational
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

    Permalink
  2. abstract def +(rhs: Rational): Rational

    Permalink
  3. abstract def -(rhs: Rational): Rational

    Permalink
  4. abstract def /(rhs: Rational): Rational

    Permalink
  5. abstract def ceil: Rational

    Permalink
  6. abstract def compare(that: Rational): Int

    Permalink
    Definition Classes
    Ordered
  7. abstract def compareToOne: Int

    Permalink
  8. abstract def denominator: SafeLong

    Permalink
  9. abstract def denominatorAbsIsValidLong: Boolean

    Permalink
    Attributes
    protected
  10. abstract def denominatorAsLong: Long

    Permalink
  11. abstract def denominatorIsValidLong: Boolean

    Permalink
  12. abstract def doubleValue(): Double

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  13. abstract def floor: Rational

    Permalink
  14. abstract def isOne: Boolean

    Permalink
  15. abstract def isValidLong: Boolean

    Permalink
  16. abstract def isWhole(): Boolean

    Permalink
    Definition Classes
    Rational → ScalaNumericAnyConversions → ScalaNumber
  17. abstract def isZero: Boolean

    Permalink
  18. abstract def numerator: SafeLong

    Permalink
  19. abstract def numeratorAbsIsValidLong: Boolean

    Permalink
    Attributes
    protected
  20. abstract def numeratorAsLong: Long

    Permalink
  21. abstract def numeratorIsValidLong: Boolean

    Permalink
  22. abstract def pow(exp: Int): Rational

    Permalink
  23. abstract def reciprocal: Rational

    Permalink
  24. abstract def round: Rational

    Permalink
  25. abstract def signum: Int

    Permalink
  26. abstract def toSafeLong: SafeLong

    Permalink
  27. abstract def unary_-(): Rational

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def %(rhs: Rational): Rational

    Permalink
  4. def <(that: Rational): Boolean

    Permalink
    Definition Classes
    Ordered
  5. def <=(that: Rational): Boolean

    Permalink
    Definition Classes
    Ordered
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. def >(that: Rational): Boolean

    Permalink
    Definition Classes
    Ordered
  8. def >=(that: Rational): Boolean

    Permalink
    Definition Classes
    Ordered
  9. def abs: Rational

    Permalink
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def byteValue(): Byte

    Permalink
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def compareTo(that: Rational): Int

    Permalink
    Definition Classes
    Ordered → Comparable
  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(that: Any): Boolean

    Permalink
    Definition Classes
    Rational → AnyRef → Any
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def floatValue(): Float

    Permalink
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  18. def gcd(rhs: Rational): Rational

    Permalink
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. def intValue(): Int

    Permalink
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  22. def inverse: Rational

    Permalink
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isValidByte: Boolean

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  25. def isValidChar: Boolean

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  26. def isValidInt: Boolean

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  27. def isValidShort: Boolean

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  28. def lcm(rhs: Rational): Rational

    Permalink
  29. def limitDenominatorTo(limit: SafeLong): Rational

    Permalink

    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

  30. def limitTo(max: SafeLong): Rational

    Permalink

    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.

  31. def limitToInt: Rational

    Permalink

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

  32. def limitToLong: Rational

    Permalink

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

  33. def longValue(): Long

    Permalink
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  34. def max(rhs: Rational): Rational

    Permalink
  35. def min(rhs: Rational): Rational

    Permalink
  36. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  37. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. def roundTo(denom: SafeLong): Rational

    Permalink
  40. def shortValue(): Short

    Permalink
    Definition Classes
    Rational → ScalaNumericAnyConversions → Number
  41. def sign: Sign

    Permalink
  42. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  43. def tmod(rhs: Rational): Rational

    Permalink
  44. def toAlgebraic: Algebraic

    Permalink
  45. def toBigDecimal(mc: MathContext): BigDecimal

    Permalink
  46. def toBigDecimal(scale: Int, mode: RoundingMode): BigDecimal

    Permalink
  47. final def toBigInt: BigInt

    Permalink
  48. def toByte: Byte

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  49. def toChar: Char

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  50. def toDouble: Double

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  51. def toFloat: Float

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  52. def toInt: Int

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  53. def toLong: Long

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  54. def toReal: Real

    Permalink
  55. def toShort: Short

    Permalink
    Definition Classes
    ScalaNumericAnyConversions
  56. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  57. def tquot(rhs: Rational): Rational

    Permalink
  58. def tquotmod(rhs: Rational): (Rational, Rational)

    Permalink
  59. def underlying(): AnyRef

    Permalink
    Definition Classes
    Rational → ScalaNumericConversions → ScalaNumericAnyConversions → ScalaNumber
  60. def unifiedPrimitiveEquals(x: Any): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    ScalaNumericAnyConversions
  61. def unifiedPrimitiveHashcode(): Int

    Permalink
    Attributes
    protected
    Definition Classes
    ScalaNumericAnyConversions
  62. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

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