sealed abstract class Rational extends ScalaNumber with ScalaNumericConversions with Ordered[Rational]
- Self Type
- Rational
- Alphabetic
- By Inheritance
- Rational
- Ordered
- Comparable
- ScalaNumericConversions
- ScalaNumericAnyConversions
- ScalaNumber
- Number
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
- abstract def *(rhs: Rational): Rational
- abstract def +(rhs: Rational): Rational
- abstract def -(rhs: Rational): Rational
- abstract def /(rhs: Rational): Rational
- abstract def ceil: Rational
-
abstract
def
compare(that: Rational): Int
- Definition Classes
- Ordered
- abstract def compareToOne: Int
- abstract def denominator: SafeLong
- abstract def denominatorAsLong: Long
-
abstract
def
doubleValue(): Double
- Definition Classes
- ScalaNumericAnyConversions
- abstract def floor: Rational
- abstract def gcd(rhs: Rational): Rational
- abstract def isOne: Boolean
- abstract def isValidLong: Boolean
-
abstract
def
isWhole(): Boolean
- Definition Classes
- Rational → ScalaNumericAnyConversions → ScalaNumber
- abstract def isZero: Boolean
- abstract def numerator: SafeLong
- abstract def numeratorAsLong: Long
- abstract def pow(exp: Int): Rational
- abstract def reciprocal: Rational
- abstract def round: Rational
- abstract def signum: Int
- abstract def toSafeLong: SafeLong
- abstract def unary_-(): Rational
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def %(rhs: Rational): Rational
- def /%(rhs: Rational): (Rational, Rational)
- def /~(rhs: Rational): Rational
-
def
<(that: Rational): Boolean
- Definition Classes
- Ordered
-
def
<=(that: Rational): Boolean
- Definition Classes
- Ordered
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
>(that: Rational): Boolean
- Definition Classes
- Ordered
-
def
>=(that: Rational): Boolean
- Definition Classes
- Ordered
- def abs: Rational
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
byteValue(): Byte
- Definition Classes
- Rational → ScalaNumericAnyConversions → Number
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
compareTo(that: Rational): Int
- Definition Classes
- Ordered → Comparable
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(that: Any): Boolean
- Definition Classes
- Rational → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
floatValue(): Float
- Definition Classes
- Rational → ScalaNumericAnyConversions → Number
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
intValue(): Int
- Definition Classes
- Rational → ScalaNumericAnyConversions → Number
- def inverse: Rational
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isValidByte: Boolean
- Definition Classes
- ScalaNumericAnyConversions
-
def
isValidChar: Boolean
- Definition Classes
- ScalaNumericAnyConversions
-
def
isValidInt: Boolean
- Definition Classes
- ScalaNumericAnyConversions
-
def
isValidShort: Boolean
- Definition Classes
- ScalaNumericAnyConversions
-
def
limitDenominatorTo(limit: SafeLong): Rational
Finds the closest
Rationalto thisRationalwhose denominator is no larger thanlimit.Finds the closest
Rationalto thisRationalwhose denominator is no larger thanlimit.See http://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree#Mediants_and_binary_search
-
def
limitTo(max: SafeLong): Rational
Returns a
Rationalwhose denominator and numerator are no larger thanmaxand whose value is close to the original.Returns a
Rationalwhose denominator and numerator are no larger thanmaxand whose value is close to the original. This applies, even if, for example, thisRationalis greater thanmax. In that case,Rational(max, 1)is returned.- max
A positive integer.
-
def
limitToInt: Rational
Returns a
Rationalwhose numerator and denominator both fit in anInt. -
def
limitToLong: Rational
Returns a
Rationalwhose numerator and denominator both fit in aLong. -
def
longValue(): Long
- Definition Classes
- Rational → ScalaNumericAnyConversions → Number
- def max(rhs: Rational): Rational
- def min(rhs: Rational): Rational
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- def roundTo(denom: SafeLong): Rational
-
def
shortValue(): Short
- Definition Classes
- Rational → ScalaNumericAnyConversions → Number
- def sign: Sign
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toAlgebraic: Algebraic
- def toBigDecimal(mc: MathContext): BigDecimal
- def toBigDecimal(scale: Int, mode: RoundingMode): BigDecimal
- final def toBigInt: BigInt
-
def
toByte: Byte
- Definition Classes
- ScalaNumericAnyConversions
-
def
toChar: Char
- Definition Classes
- ScalaNumericAnyConversions
-
def
toDouble: Double
- Definition Classes
- ScalaNumericAnyConversions
-
def
toFloat: Float
- Definition Classes
- ScalaNumericAnyConversions
-
def
toInt: Int
- Definition Classes
- ScalaNumericAnyConversions
-
def
toLong: Long
- Definition Classes
- ScalaNumericAnyConversions
- def toReal: Real
-
def
toShort: Short
- Definition Classes
- ScalaNumericAnyConversions
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
underlying(): AnyRef
- Definition Classes
- Rational → ScalaNumericConversions → ScalaNumericAnyConversions → ScalaNumber
-
def
unifiedPrimitiveEquals(x: Any): Boolean
- Attributes
- protected
- Definition Classes
- ScalaNumericAnyConversions
-
def
unifiedPrimitiveHashcode(): Int
- Attributes
- protected
- Definition Classes
- ScalaNumericAnyConversions
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )