public function BigInteger(value:* = null, radix:int = 0, unsigned:Boolean = false)
Parameters | value:* (default = null) |
| |
| radix:int (default = 0) — WARNING: If value is ByteArray, this holds the number of bytes to use.
|
| |
| unsigned:Boolean (default = false) |
public function abs():BigInteger
|this|
Returns public function add(a:BigInteger):BigInteger
Parameters
Returns protected function addTo(a:BigInteger, r:BigInteger):void
Parameters
bi_internal function am(i:int, x:int, w:BigInteger, j:int, c:int, n:int):int Parameters
Returns public function and(a:BigInteger):BigInteger Parameters
Returns public function andNot(a:BigInteger):BigInteger Parameters
Returns public function bitCount():int
Returns public function bitLength():int
returns the number of bits in this
Returns protected function bitwiseTo(a:BigInteger, op:Function, r:BigInteger):void
Parameters
| a:BigInteger — a BigInteger to perform the operation with
|
| |
| op:Function — a Function implementing the operation
|
| |
| r:BigInteger — a BigInteger to store the result of the operation
|
public function byteValue():int
Returns protected function changeBit(n:int, op:Function):BigInteger
Parameters
Returns protected function chunkSize(r:Number):int
Parameters
Returns bi_internal function clamp():void
clamp off excess high words
public function clearBit(n:int):BigInteger
Parameters
Returns public function clone():BigIntegerReturns public function compareTo(v:BigInteger):int Parameters
Returns bi_internal function copyTo(r:BigInteger):void
copy this to r
Parameters
bi_internal function dAddOffset(n:int, w:int):void Parameters
public function dispose():void public function divide(a:BigInteger):BigInteger
Parameters
Returns public function divideAndRemainder(a:BigInteger):Array
Parameters
Returns bi_internal function divRemTo(m:BigInteger, q:BigInteger = null, r:BigInteger = null):void
divide this by m, quotient and remainder to q, r (HAC 14.20)
r != q, this != m. q or r may be null.
Parameters
bi_internal function dlShiftTo(n:int, r:BigInteger):void Parameters
bi_internal function dMultiply(n:int):void Parameters
bi_internal function drShiftTo(n:int, r:BigInteger):void
r = this >> nB
Parameters
public function equals(a:BigInteger):Boolean Parameters
Returns bi_internal function exp(e:int, z:IReduction):BigInteger Parameters
Returns public function flipBit(n:int):BigInteger
Parameters
Returns bi_internal function fromArray(value:ByteArray, length:int, unsigned:Boolean = false):void
set from ByteArray and length,
starting a current position
If length goes beyond the array, pad with zeroes.
Parameters
| value:ByteArray |
| |
| length:int |
| |
| unsigned:Boolean (default = false) |
bi_internal function fromInt(value:int):void Parameters
protected function fromRadix(s:String, b:int = 10):void
Parameters
| s:String — a string to convert from using radix.
|
| |
| b:int (default = 10) — a radix
|
public function gcd(a:BigInteger):BigInteger
Parameters
Returns public function getLowestSetBit():int
Returns | int — index of lowest 1-bit (or -1 if none)
|
bi_internal function intAt(str:String, index:int):int Parameters
Returns public function intValue():int
Returns bi_internal function invDigit():int
return "-1/this % 2^DB"; useful for Mont. reduction
justification:
xy == 1 (mod n)
xy = 1+km
xy(2-xy) = (1+km)(1-km)
x[y(2-xy)] = 1-k^2.m^2
x[y(2-xy)] == 1 (mod m^2)
if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
should reduce x and y(2-xy) by m^2 at each step to keep size bounded
[XXX unit test the living shit out of this.]
Returns bi_internal function isEven():Boolean
true iff this is even
Returns public function isProbablePrime(t:int):Boolean
Parameters
Returns | Boolean — primality with certainty >= 1-.5^t
|
bi_internal function lShiftTo(n:int, r:BigInteger):void Parameters
public function max(a:BigInteger):BigInteger Parameters
Returns protected function millerRabin(t:int):Boolean
Parameters
Returns | Boolean — true if probably prime (HAC 4.24, Miller-Rabin)
|
public function min(a:BigInteger):BigInteger Parameters
Returns public function mod(v:BigInteger):BigInteger
Parameters
Returns protected function modInt(n:int):int
Parameters
Returns public function modInverse(m:BigInteger):BigInteger
Parameters
Returns public function modPow(e:BigInteger, m:BigInteger):BigInteger
Parameters
Returns public function modPowInt(e:int, m:BigInteger):BigInteger Parameters
Returns public function multiply(a:BigInteger):BigInteger
Parameters
Returns bi_internal function multiplyLowerTo(a:BigInteger, n:int, r:BigInteger):void
Parameters
bi_internal function multiplyTo(v:BigInteger, r:BigInteger):void
r = this v, r != this,a (HAC 14.12)
"this" should be the larger one if appropriate
Parameters
bi_internal function multiplyUpperTo(a:BigInteger, n:int, r:BigInteger):void
Parameters
protected function nbi():*Returns bi_internal function nbits(x:int):int
returns bit length of the integer x
Parameters
Returns public static function nbv(value:int):BigInteger
return bigint initialized to value
Parameters
Returns public function negate():BigInteger
-this
Returns public function not():BigIntegerReturns public function or(a:BigInteger):BigInteger Parameters
Returns public function pow(e:int):BigInteger
Parameters
Returns public function primify(bits:int, t:int):void
Tweak our BigInteger until it looks prime enough
Parameters
public function remainder(a:BigInteger):BigInteger Parameters
Returns bi_internal function rShiftTo(n:int, r:BigInteger):void
r = this >> n
Parameters
public function setBit(n:int):BigInteger
Parameters
Returns public function shiftLeft(n:int):BigInteger Parameters
Returns public function shiftRight(n:int):BigInteger Parameters
Returns public function shortValue():int
Returns | int — value as short (assumes DB>=16)
|
public function sigNum():int
Returns | int — 0 if this ==0, 1 if this >0
|
bi_internal function squareTo(r:BigInteger):void
r = this^2, r != this (HAC 14.16)
Parameters
bi_internal function subTo(v:BigInteger, r:BigInteger):void
r = this - v
Parameters
public function subtract(a:BigInteger):BigInteger
Parameters
Returns public function testBit(n:int):Boolean
Parameters
Returns | Boolean — true iff nth bit is set
|
public function toArray(array:ByteArray):uint Parameters
Returns public function toByteArray():ByteArray
Returns | ByteArray — a byte array.
|
protected function toRadix(b:uint = 10):String
Parameters
| b:uint (default = 10) — radix to use
|
Returns | String — a string representing the integer converted to the radix.
|
public function toString(radix:Number = 16):String Parameters
| radix:Number (default = 16) |
Returns public function valueOf():Number
best-effort attempt to fit into a Number.
precision can be lost if it just can't fit.
Returns public function xor(a:BigInteger):BigInteger Parameters
Returnspublic static const BI_FP:int = 52public static const DB:int = 30public static const DM:intpublic static const DV:intpublic static const F1:int = 22.0public static const F2:int = 8.0public static const FV:Numberpublic static const lowprimes:Arraypublic static const lplim:intpublic static const ONE:BigIntegerpublic static const ZERO:BigInteger
Mon May 20 2013, 09:16 PM +02:00