Scala Library


scala/BigInt.scala
]
class
BigInt(val
bigInteger : java.math.BigInteger)
extends
java.lang.Number with
AnyRefMethod Summary  
def

%
(that : BigInt) : BigInt
Remainder of BigInts

def

&
(that : BigInt) : BigInt
Bitwise and of BigInts

def

&~
(that : BigInt) : BigInt
Bitwise andnot of BigInts. Returns a BigInt whose value is (this & ~that).

def

*
(that : BigInt) : BigInt
Multiplication of BigInts

def

+
(that : BigInt) : BigInt
Addition of BigInts

def


(that : BigInt) : BigInt
Subtraction of BigInts

def

/
(that : BigInt) : BigInt
Division of BigInts

def

/%
(that : BigInt) : (BigInt, BigInt)
Returns a pair of two BigInts containing (this / that) and (this % that).

def

<
(that : BigInt) : Boolean
Lessthan of BigInts

def

<<
(n : Int) : BigInt
Leftshift of BigInt

def

<=
(that : BigInt) : Boolean
Lessthanorequals comparison of BigInts

def

>
(that : BigInt) : Boolean
Greaterthan comparison of BigInts

def

>=
(that : BigInt) : Boolean
Greaterthanorequals comparison of BigInts

def

>>
(n : Int) : BigInt
(Signed) rightshift of BigInt

def

^
(that : BigInt) : BigInt
Bitwise exclusiveor of BigInts

def

abs
: BigInt
Returns the absolute value of this BigInt

def

bitCount
: Int
Returns the number of bits in the two's complement representation of this BigInt
that differ from its sign bit.

def

bitLength
: Int
Returns the number of bits in the minimal two'scomplement representation of this BigInt,
excluding a sign bit.

override def

byteValue
: Byte
Converts this BigInt to a byte.
If the BigInt is too big to fit in a byte, only the loworder 8 bits are returned.
Note that this conversion can lose information about the overall magnitude of the
BigInt value as well as return a result with the opposite sign.

def

charValue
: Char
Converts this BigInt to a char.
If the BigInt is too big to fit in a char, only the loworder 16 bits are returned.
Note that this conversion can lose information about the overall magnitude of the
BigInt value and that it always returns a positive result.

def

clearBit
(n : Int) : BigInt
Returns a BigInt whose value is equivalent to this BigInt with the designated bit cleared.

def

compare
(that : BigInt) : Int
Compares this BigInt with the specified BigInt

def

doubleValue
: Double
Converts this BigInt to a double.
if this BigInt has too great a magnitude to represent as a float,
it will be converted to
Float.NEGATIVE_INFINITY or
Float.POSITIVE_INFINITY as appropriate. 
override def

equals
(that : Any) : Boolean
Compares this BigInt with the specified value for equality.

def

equals
(that : BigInt) : Boolean
Compares this BigInt with the specified BigInt for equality.

def

flipBit
(n : Int) : BigInt
Returns a BigInt whose value is equivalent to this BigInt with the designated bit flipped.

def

floatValue
: Float
Converts this BigInt to a float.
if this BigInt has too great a magnitude to represent as a float,
it will be converted to
Float.NEGATIVE_INFINITY or
Float.POSITIVE_INFINITY as appropriate. 
def

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

override def

hashCode
: Int
Returns the hash code for this BigInt.

def

intValue
: Int
Converts this BigInt to an int.
If the BigInt is too big to fit in a char, only the loworder 32 bits
are returned. Note that this conversion can lose information about the
overall magnitude of the BigInt value as well as return a result with
the opposite sign.

def

isProbablePrime
(certainty : Int) : Boolean
Returns true if this BigInt is probably prime, false if it's definitely composite.

def

longValue
: Long
Converts this BigInt to a long.
If the BigInt is too big to fit in a char, only the loworder 64 bits
are returned. Note that this conversion can lose information about the
overall magnitude of the BigInt value as well as return a result with
the opposite sign.

def

lowestSetBit
: Int
Returns the index of the rightmost (lowestorder) one bit in this BigInt
(the number of zero bits to the right of the rightmost one bit).

def

max
(that : BigInt) : BigInt
Returns the maximum of this and that

def

min
(that : BigInt) : BigInt
Returns the minimum of this and that

def

mod
(that : BigInt) : BigInt
Returns a BigInt whose value is (this mod m).
This method differs from `%' in that it always returns a nonnegative BigInt.

def

modInverse
(m : BigInt) : BigInt
Returns a BigInt whose value is (the inverse of this modulo m).

def

modPow
(exp : BigInt, m : BigInt) : BigInt
Returns a BigInt whose value is
(this raised to the power of exp modulo m).

def

pow
(exp : Int) : BigInt
Returns a BigInt whose value is (this raised to the power of exp).

def

setBit
(n : Int) : BigInt
Returns a BigInt whose value is equivalent to this BigInt with the designated bit set.

override def

shortValue
: Short
Converts this BigInt to a short.
If the BigInt is too big to fit in a byte, only the loworder 16 bits are returned.
Note that this conversion can lose information about the overall magnitude of the
BigInt value as well as return a result with the opposite sign.

def

signum
: Int
Returns the sign of this BigInt, i.e.
1 if it is less than 0,
+1 if it is greater than 0
0 if it is equal to 0

def

testBit
(n : Int) : Boolean
Returns true if and only if the designated bit is set.

def

toByteArray
: Array[Byte]
Returns a byte array containing the two'scomplement representation of
this BigInt. The byte array will be in bigendian byteorder: the most
significant byte is in the zeroth element. The array will contain the
minimum number of bytes required to represent this BigInt, including at
least one sign bit.

def

toString
(radix : Int) : java.lang.String
Returns the String representation in the specified radix of this BigInt.

override def

toString
: java.lang.String
Returns the decimal String representation of this BigInt.

def

unary_
: BigInt
Returns a BigInt whose value is the negation of this BigInt

def


(that : BigInt) : BigInt
Bitwise or of BigInts

def

~
: BigInt
Returns the bitwise complement of this BigNum

Methods inherited from AnyRef  
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized 
Methods inherited from Any  
==, !=, isInstanceOf, asInstanceOf 
Method Details 
override
def
hashCode : Int
def
unary_ : BigInt
def
abs : BigInt
def
signum : Int
def
~ : BigInt
def
lowestSetBit : Int
def
bitLength : Int
def
bitCount : Int
certainty 
a measure of the uncertainty that the caller is willing to tolerate: if the call returns true the probability that this BigInt is prime
exceeds (1  1/2 ^ certainty).
The execution time of this method is proportional to the value of
this parameter.override
def
byteValue : Byte
override
def
shortValue : Short
def
charValue : Char
def
intValue : Int
def
longValue : Long
def
floatValue : Float
Float.NEGATIVE_INFINITY
or
Float.POSITIVE_INFINITY
as appropriate.
def
doubleValue : Double
Float.NEGATIVE_INFINITY
or
Float.POSITIVE_INFINITY
as appropriate.override
def
toString : java.lang.String
def
toString(radix : Int) : java.lang.String
Scala Library

