spire.math

Rational

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

Linear Supertypes
Ordered[Rational], Comparable[Rational], ScalaNumericConversions, ScalaNumber, java.lang.Number, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Rational
  2. Ordered
  3. Comparable
  4. ScalaNumericConversions
  5. ScalaNumber
  6. Number
  7. Serializable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Rational()

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 compare(that: Rational): Int

    Definition Classes
    Ordered
  6. abstract def denominator: BigInt

  7. abstract def doubleValue(): Double

    Definition Classes
    ScalaNumericConversions
  8. abstract def floatValue(): Float

    Definition Classes
    ScalaNumericConversions
  9. abstract def intValue(): Int

    Definition Classes
    ScalaNumericConversions
  10. abstract def isWhole(): Boolean

    Definition Classes
    ScalaNumericConversions
  11. abstract def log(): Rational

  12. abstract def longValue(): Long

    Definition Classes
    ScalaNumericConversions
  13. abstract def numerator: BigInt

  14. abstract def pow(exp: Int): Rational

  15. abstract def toBigDecimal: BigDecimal

  16. abstract def toBigInt: BigInt

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

  5. def <(that: Rational): Boolean

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

    Definition Classes
    Ordered
  7. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  9. def >(that: Rational): Boolean

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

    Definition Classes
    Ordered
  11. def abs: Rational

  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. def byteValue(): Byte

    Definition Classes
    Rational → ScalaNumericConversions → Number
  14. def ceil: Rational

  15. def clone(): AnyRef

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

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

    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  20. def floor: Rational

  21. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  23. def inverse: Rational

  24. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  25. def isValidByte: Boolean

    Definition Classes
    ScalaNumericConversions
  26. def isValidChar: Boolean

    Definition Classes
    ScalaNumericConversions
  27. def isValidInt: Boolean

    Definition Classes
    ScalaNumericConversions
  28. def isValidShort: Boolean

    Definition Classes
    ScalaNumericConversions
  29. def limitDenominatorTo(limit: BigInt): 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

  30. def limitTo(max: BigInt): 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.

  31. def limitToInt: Rational

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

  32. def limitToLong: Rational

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

  33. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. final def notify(): Unit

    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  36. def nroot(k: Int)(implicit ctxt: ApproximationContext[Rational]): Rational

    Find the n-th root of this Rational.

    Find the n-th root of this Rational. This requires an (implicit) ApproximationContext to bound the allowable absolute error of the answer.

  37. def pow(exp: Rational)(implicit ctxt: ApproximationContext[Rational]): Rational

    Returns this Rational to the exponent exp.

    Returns this Rational to the exponent exp. Both the numerator and denominator of exp must be valid integers. Anything larger will cause pow to throw an ArithmeticException.

  38. def quot(rhs: Rational): Rational

  39. def shortValue(): Short

    Definition Classes
    Rational → ScalaNumericConversions → Number
  40. def sign: Sign

  41. def signum: Int

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

    Definition Classes
    AnyRef
  43. def toByte: Byte

    Definition Classes
    ScalaNumericConversions
  44. def toChar: Char

    Definition Classes
    ScalaNumericConversions
  45. def toDouble: Double

    Definition Classes
    ScalaNumericConversions
  46. def toFloat: Float

    Definition Classes
    ScalaNumericConversions
  47. def toInt: Int

    Definition Classes
    ScalaNumericConversions
  48. def toLong: Long

    Definition Classes
    ScalaNumericConversions
  49. def toShort: Short

    Definition Classes
    ScalaNumericConversions
  50. def toString(): String

    Definition Classes
    AnyRef → Any
  51. def unary_-(): Rational

  52. def underlying(): List[Any]

    Definition Classes
    Rational → ScalaNumericConversions → ScalaNumber
  53. def unifiedPrimitiveEquals(x: Any): Boolean

    Attributes
    protected
    Definition Classes
    ScalaNumericConversions
  54. def unifiedPrimitiveHashcode(): Int

    Attributes
    protected
    Definition Classes
    ScalaNumericConversions
  55. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Ordered[Rational]

Inherited from Comparable[Rational]

Inherited from ScalaNumericConversions

Inherited from ScalaNumber

Inherited from java.lang.Number

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped