final class IdealRat extends Ordered[IdealRat]
Naive implementation of rational numbers
- Alphabetic
- By Inheritance
- IdealRat
- Ordered
- Comparable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def *(that: IdealRat): IdealRat
Multiplication of
IdealRat
- def +(that: IdealRat): IdealRat
Addition of
IdealRat
- def -(that: IdealRat): IdealRat
Subtraction of
IdealRat
- def /(that: IdealRat): IdealRat
Division of
IdealRat
.Division of
IdealRat
. We use euclidian division with remainder, i.e., the propertythis == (this / that) * that + (this % that)
holds, andthis % that >= 0
andthis % that < that.abs
.TODO: make this more efficient
- def <(that: IdealRat): Boolean
- Definition Classes
- Ordered
- def <=(that: IdealRat): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: IdealRat): Boolean
- Definition Classes
- Ordered
- def >=(that: IdealRat): Boolean
- Definition Classes
- Ordered
- def abs: IdealRat
Returns the absolute value of this
IdealRat
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def compare(that: IdealRat): Int
Compares this
IdealRat
with the specifiedIdealRat
Compares this
IdealRat
with the specifiedIdealRat
- Definition Classes
- IdealRat → Ordered
- def compareTo(that: IdealRat): Int
- Definition Classes
- Ordered → Comparable
- val denom: IdealInt
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(that: IdealRat): Boolean
Compares this
IdealRat
with the specifiedIdealRat
for equality. - 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
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
Returns the hash code for this
IdealRat
.Returns the hash code for this
IdealRat
.- Definition Classes
- IdealRat → AnyRef → Any
- def intValue: Int
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isMinusOne: Boolean
Returns
true
iff thisIdealRat
is -one - def isOne: Boolean
Returns
true
iff thisIdealRat
is one - def isUnit: Boolean
Returns
true
iff thisIdealRat
is one or -one - def isZero: Boolean
Returns
true
iff thisIdealRat
is zero - def longValue: Long
- def max(that: IdealRat): IdealRat
Returns the maximum of this and that
- def min(that: IdealRat): IdealRat
Returns the minimum of this and that
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- val num: IdealInt
- 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 - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
Returns the
String
representation of thisIdealRat
.Returns the
String
representation of thisIdealRat
.- Definition Classes
- IdealRat → AnyRef → Any
- def unary_-: IdealRat
Returns a
IdealRat
whose value is the negation of thisIdealRat
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)