Packages

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. Protected

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

  6. def +(that: IdealInt): IdealInt

    Addition of IdealInt

  7. def -(that: IdealInt): 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

  11. def <<(shift: IdealInt): IdealInt

    Left-shift.

    Left-shift. For positive shifts, this is equivalent to multiplication by pow2(shift). Negative shifts are equivalent to right-shift by the negated value.

  12. def <<(shift: Int): IdealInt

    Left-shift.

    Left-shift. For positive shifts, this is equivalent to multiplication by pow2(shift). Negative shifts are equivalent to right-shift by the negated value.

  13. def <=(that: IdealInt): Boolean

    Less-than-or-equals comparison of IdealInt

  14. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def >(that: IdealInt): Boolean

    Greater-than comparison of IdealInt

  16. def >=(that: IdealInt): Boolean

    Greater-than-or-equals comparison of IdealInt

  17. def >>(shift: IdealInt): IdealInt

    Right-shift with sign extension.

    Right-shift with sign extension. For positive shifts, this is equivalent to division by pow2(shift). Negative shifts are equivalent to left-shift by the negated value.

  18. def >>(shift: Int): IdealInt

    Right-shift with sign extension.

    Right-shift with sign extension. For positive shifts, this is equivalent to division by pow2(shift). Negative shifts are equivalent to left-shift by the negated value.

  19. def ^(that: IdealInt): IdealInt

    Bit-wise xor.

  20. def abs: IdealInt

    Returns the absolute value of this IdealInt

  21. 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.

  22. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  23. def bigIntValue: BigInteger

    Converts this IdealInt to an BigInt.

  24. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  25. def compare(that: IdealInt): Int

    Compares this IdealInt with the specified IdealInt

  26. 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 < ...

  27. def divides(that: IdealInt): Boolean

    Return whether this divides that

  28. def doubleValue: Double
  29. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. def equals(that: IdealInt): Boolean

    Compares this IdealInt with the specified IdealInt for equality.

  31. 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
  32. def floatValue: Float
  33. def gcd(that: IdealInt): IdealInt

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

  34. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  35. def getHighestSetBit: Int

    For a positive number, determine the index of the highest bit that is set.

    For a positive number, determine the index of the highest bit that is set. For instance, IdealInt.ONE.getHighestSetBit == 0.

  36. def hashCode(): Int

    Returns the hash code for this IdealInt.

    Returns the hash code for this IdealInt.

    Definition Classes
    IdealInt → AnyRef → Any
  37. 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.

  38. def intValueSafe: Int
  39. def invert: IdealInt

    Bit-wise inversion of this IdealInt

  40. 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

  41. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  42. def isMinusOne: Boolean

    Returns true iff this IdealInt is -one

  43. def isOne: Boolean

    Returns true iff this IdealInt is one

  44. def isProbablePrime(certainty: Int): Boolean

    Function corresponding to BigInteger.isProbablePrime

  45. def isUnit: Boolean

    Returns true iff this IdealInt is one or -one

  46. def isZero: Boolean

    Returns true iff this IdealInt is zero

  47. def lcm(that: IdealInt): IdealInt

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

  48. 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.

  49. def max(that: IdealInt): IdealInt

    Returns the maximum of this and that

  50. def min(that: IdealInt): IdealInt

    Returns the minimum of this and that

  51. def moduloKeepingSign(that: IdealInt): IdealInt

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

    Reduce this by adding a multiple of that and return the remainder. In contrast to %, reduction is done so that the remainder has the same sign as this, unless the remainder is zero.

  52. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  53. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  54. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  55. def pow(exp: Int): IdealInt

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

  56. def powMod(exp: IdealInt, modulus: IdealInt): IdealInt

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

  57. 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.

  58. def shiftLeftAddOnes(shift: IdealInt): IdealInt

    Shift left, filling up with ones.

    Shift left, filling up with ones. This is equivalent to ((this + 1) << shift) - 1.

  59. def shiftLeftAddOnes(shift: Int): IdealInt

    Shift left, filling up with ones.

    Shift left, filling up with ones. This is equivalent to ((this + 1) << shift) - 1.

  60. 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

  61. def sqrt: IdealInt

    For a non-negative number this, return the greatest number s such that s*s <= this.

  62. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  63. def toString(): String

    Returns the decimal String representation of this IdealInt.

    Returns the decimal String representation of this IdealInt.

    Definition Classes
    IdealInt → AnyRef → Any
  64. def unary_-: IdealInt

    Returns a IdealInt whose value is the negation of this IdealInt

  65. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  66. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  67. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  68. def |(that: IdealInt): IdealInt

    Bit-wise or.

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped