# IdealInt

### Related Docs: object IdealInt | package basetypes

#### final class IdealInt extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
1. Alphabetic
2. By inheritance
Inherited
1. IdealInt
2. AnyRef
3. 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: IdealInt): IdealInt

Remainder of `IdealInt`.

Remainder of `IdealInt`. 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

4. #### def &(that: IdealInt): IdealInt

Bit-wise and.

5. #### def *(that: IdealInt): IdealInt

Multiplication of `IdealInt`

Multiplication of `IdealInt`

6. #### def +(that: IdealInt): IdealInt

Addition of `IdealInt`

Addition of `IdealInt`

7. #### def -(that: IdealInt): IdealInt

Subtraction of `IdealInt`

Subtraction of `IdealInt`

8. #### def /(that: IdealInt): IdealInt

Division of `IdealInt`.

Division of `IdealInt`. 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

9. #### def /%(that: IdealInt): (IdealInt, IdealInt)

Returns a pair of two `IdealInt` containing (this / that) and (this % that).

Returns a pair of two `IdealInt` containing (this / that) and (this % that). 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`.

10. #### def <(that: IdealInt): Boolean

Less-than of `IdealInt`

Less-than of `IdealInt`

11. #### def <=(that: IdealInt): Boolean

Less-than-or-equals comparison of `IdealInt`

Less-than-or-equals comparison of `IdealInt`

12. #### final def ==(arg0: Any): Boolean

Definition Classes
AnyRef → Any
13. #### def >(that: IdealInt): Boolean

Greater-than comparison of `IdealInt`

Greater-than comparison of `IdealInt`

14. #### def >=(that: IdealInt): Boolean

Greater-than-or-equals comparison of `IdealInt`

Greater-than-or-equals comparison of `IdealInt`

15. #### def ^(that: IdealInt): IdealInt

Bit-wise xor.

16. #### def abs: IdealInt

Returns the absolute value of this `IdealInt`

Returns the absolute value of this `IdealInt`

17. #### def anyDivideAndRemainder(that: IdealInt): (IdealInt, IdealInt)

Returns a pair of two `IdealInt` containing `(this / that)` and `(this % that)`.

Returns a pair of two `IdealInt` containing `(this / that)` and `(this % that)`. This operation only guarantees `this == (this / that) * that + (this % that)`, and that the absolute value of `(this % that)` is less than the absolute value of `that`.

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

Definition Classes
Any
19. #### def bigIntValue: BigInteger

Converts this `IdealInt` to an BigInt.

Converts this `IdealInt` to an BigInt.

20. #### def clone(): AnyRef

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

Compares this `IdealInt` with the specified `IdealInt`

Compares this `IdealInt` with the specified `IdealInt`

22. #### def compareAbs(that: IdealInt): Int

A total order on integers that first compares the absolute value and then the sign: 0 < 1 < -1 < 2 < -2 < 3 < -3 < ...

23. #### def divides(that: IdealInt): Boolean

Return whether this divides that

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

Definition Classes
AnyRef
26. #### def equals(that: IdealInt): Boolean

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

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

27. #### def equals(that: Any): Boolean

Compares this `IdealInt` with the specified value for equality.

Compares this `IdealInt` with the specified value for equality.

Definition Classes
IdealInt → AnyRef → Any
28. #### def finalize(): Unit

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )

30. #### def gcd(that: IdealInt): IdealInt

Returns the greatest common divisor of abs(this) and abs(that)

31. #### final def getClass(): Class[_]

Definition Classes
AnyRef → Any

33. #### def hashCode(): Int

Returns the hash code for this `IdealInt`.

Returns the hash code for this `IdealInt`.

Definition Classes
IdealInt → AnyRef → Any
34. #### def intValue: Int

Converts this `IdealInt` to an int.

Converts this `IdealInt` to an int. If the `IdealInt` is too big to fit in a char, only the low-order 32 bits are returned. Note that this conversion can lose information about the overall magnitude of the `IdealInt` value as well as return a result with the opposite sign.

36. #### def isAbsMinMod(that: IdealInt): Boolean

Return whether `this` is minimal (in the `compareAbs` order) modulo `that`, i.e., if `that` is zero or if `(this compareAbs (this + a*that)) <= 0` for all non-zero `a`

Return whether `this` is minimal (in the `compareAbs` order) modulo `that`, i.e., if `that` is zero or if `(this compareAbs (this + a*that)) <= 0` for all non-zero `a`

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

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

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

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

39. #### def isOne: Boolean

Returns `true` iff this `IdealInt` is one

Returns `true` iff this `IdealInt` is one

40. #### def isProbablePrime(certainty: Int): Boolean

Function corresponding to `BigInteger.isProbablePrime`

Function corresponding to `BigInteger.isProbablePrime`

41. #### def isUnit: Boolean

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

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

42. #### def isZero: Boolean

Returns `true` iff this `IdealInt` is zero

Returns `true` iff this `IdealInt` is zero

43. #### def lcm(that: IdealInt): IdealInt

Returns the least common multiple of abs(this) and abs(that)

44. #### def longValue: Long

Converts this `IdealInt` to a long.

Converts this `IdealInt` to a long. If the `IdealInt` is too big to fit in a char, only the low-order 64 bits are returned. Note that this conversion can lose information about the overall magnitude of the `IdealInt` value as well as return a result with the opposite sign.

45. #### def max(that: IdealInt): IdealInt

Returns the maximum of this and that

46. #### def min(that: IdealInt): IdealInt

Returns the minimum of this and that

47. #### final def ne(arg0: AnyRef): Boolean

Definition Classes
AnyRef
48. #### final def notify(): Unit

Definition Classes
AnyRef
49. #### final def notifyAll(): Unit

Definition Classes
AnyRef
50. #### def pow(exp: Int): IdealInt

Returns a `IdealInt` whose value is (this raised to the power of exp).

Returns a `IdealInt` whose value is (this raised to the power of exp).

51. #### def powMod(exp: IdealInt, modulus: IdealInt): IdealInt

Returns a `IdealInt` whose value is (this raised to the power of exp), modulo modulus.

Returns a `IdealInt` whose value is (this raised to the power of exp), modulo modulus.

52. #### def reduceAbs(that: IdealInt): (IdealInt, IdealInt)

Reduce `this` by adding a multiple of `that` and return the quotient and the remainder.

Reduce `this` by adding a multiple of `that` and return the quotient and the remainder. In contrast to `/%`, reduction is done so that the remainder becomes minimal in the order `compareAbs`. The result has the properties `this == quot * that + rem` and `(rem compareAbs (rem + a*that)) < 0` for all non-zero `a`.

53. #### def signum: Int

Returns the sign of this `IdealInt`, i.e.

Returns the sign of this `IdealInt`, i.e. -1 if it is less than 0, +1 if it is greater than 0 0 if it is equal to 0

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

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

Returns the decimal `String` representation of this `IdealInt`.

Returns the decimal `String` representation of this `IdealInt`.

Definition Classes
IdealInt → AnyRef → Any
56. #### def unary_-: IdealInt

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

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

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

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

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

Definition Classes
AnyRef
Annotations
@throws( ... )

Bit-wise or.