# IdealRat

### Related Docs: object IdealRat | package basetypes

#### final class IdealRat extends Ordered[IdealRat]

Naive implementation of rational numbers

Linear Supertypes
Ordered[IdealRat], Comparable[IdealRat], AnyRef, Any
Ordering
1. Alphabetic
2. By Inheritance
Inherited
1. IdealRat
2. Ordered
3. Comparable
4. AnyRef
5. Any
1. Hide All
2. Show All
Visibility
1. Public
2. All

### Value Members

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

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

Definition Classes
AnyRef → Any
3. #### def *(that: IdealRat): IdealRat

Multiplication of `IdealRat`

Multiplication of `IdealRat`

4. #### def +(that: IdealRat): IdealRat

Addition of `IdealRat`

Addition of `IdealRat`

5. #### def -(that: IdealRat): IdealRat

Subtraction of `IdealRat`

Subtraction of `IdealRat`

6. #### def /(that: IdealRat): IdealRat

Division of `IdealRat`.

Division of `IdealRat`. We use euclidian division with remainder, i.e., the property `this == (this / that) * that + (this % that)` holds, and `this % that >= 0` and `this % that < that.abs`.

TODO: make this more efficient

7. #### def <(that: IdealRat): Boolean

Definition Classes
Ordered
8. #### def <=(that: IdealRat): Boolean

Definition Classes
Ordered
9. #### final def ==(arg0: Any): Boolean

Definition Classes
AnyRef → Any
10. #### def >(that: IdealRat): Boolean

Definition Classes
Ordered
11. #### def >=(that: IdealRat): Boolean

Definition Classes
Ordered
12. #### def abs: IdealRat

Returns the absolute value of this `IdealRat`

Returns the absolute value of this `IdealRat`

13. #### final def asInstanceOf[T0]: T0

Definition Classes
Any
14. #### def clone(): AnyRef

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( ... )
15. #### def compare(that: IdealRat): Int

Compares this `IdealRat` with the specified `IdealRat`

Compares this `IdealRat` with the specified `IdealRat`

Definition Classes
IdealRat → Ordered
16. #### def compareTo(that: IdealRat): Int

Definition Classes
Ordered → Comparable

18. #### final def eq(arg0: AnyRef): Boolean

Definition Classes
AnyRef
19. #### def equals(that: IdealRat): Boolean

Compares this `IdealRat` with the specified `IdealRat` for equality.

Compares this `IdealRat` with the specified `IdealRat` for equality.

20. #### 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
21. #### def finalize(): Unit

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )
22. #### final def getClass(): Class[_]

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

Returns the hash code for this `IdealRat`.

Returns the hash code for this `IdealRat`.

Definition Classes
IdealRat → AnyRef → Any

25. #### final def isInstanceOf[T0]: Boolean

Definition Classes
Any
26. #### def isMinusOne: Boolean

Returns `true` iff this `IdealRat` is -one

Returns `true` iff this `IdealRat` is -one

27. #### def isOne: Boolean

Returns `true` iff this `IdealRat` is one

Returns `true` iff this `IdealRat` is one

28. #### def isUnit: Boolean

Returns `true` iff this `IdealRat` is one or -one

Returns `true` iff this `IdealRat` is one or -one

29. #### def isZero: Boolean

Returns `true` iff this `IdealRat` is zero

Returns `true` iff this `IdealRat` is zero

31. #### def max(that: IdealRat): IdealRat

Returns the maximum of this and that

32. #### def min(that: IdealRat): IdealRat

Returns the minimum of this and that

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

37. #### 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

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

Definition Classes
AnyRef
39. #### def toString(): String

Returns the `String` representation of this `IdealRat`.

Returns the `String` representation of this `IdealRat`.

Definition Classes
IdealRat → AnyRef → Any
40. #### def unary_-: IdealRat

Returns a `IdealRat` whose value is the negation of this `IdealRat`

Returns a `IdealRat` whose value is the negation of this `IdealRat`

41. #### final def wait(): Unit

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

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

Definition Classes
AnyRef
Annotations
@throws( ... )