|
static | addHelper (array $x_value, $x_negative, array $y_value, $y_negative) |
|
static | multiplyHelper (array $x_value, $x_negative, array $y_value, $y_negative) |
|
static | regularMultiply (array $x_value, array $y_value) |
|
static | compareHelper (array $x_value, $x_negative, array $y_value, $y_negative) |
|
static | trim (array $value) |
|
static | array_repeat ($input, $multiplier) |
|
static | square (array $x) |
|
static | baseSquare (array $value) |
|
static | karatsubaSquare (array $value) |
|
static | setBitmask ($bits) |
|
static | base256_lshift (&$x, $shift) |
|
static | slidingWindow (Engine $x, Engine $e, Engine $n, $class) |
|
static | randomRangePrimeOuter (Engine $min, Engine $max) |
|
static | randomRangeHelper (Engine $min, Engine $max) |
|
static | randomRangePrimeInner (Engine $x, Engine $min, Engine $max) |
|
static | minHelper (array $nums) |
|
static | maxHelper (array $nums) |
|
| $value |
|
| $is_negative |
|
| $precision = -1 |
|
| $bitmask = false |
|
| $reduce |
|
| $hex |
|
static | $zero = [] |
|
static | $one = [] |
|
static | $two = [] |
|
static | $modexpEngine |
|
static | $isValidEngine |
|
◆ add()
◆ between()
◆ bitwise_and()
◆ bitwise_or()
◆ bitwise_xor()
◆ compare()
Compares two numbers.
Although one might think !$x->compare($y) means $x != $y, it, in fact, means the opposite. The reason for this is demonstrated thusly:
$x >
- y
x->compare($y) > 0 $x <
- y
x->compare($y) < 0 $x ==
- y
x->compare($y) == 0
Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y).
{
Références PHP\compareHelper(), et value.
Référencé par PHP32\between().
◆ divide()
Divides two BigIntegers.
Returns an array whose first element contains the quotient and whose second element contains the "common residue". If the remainder would be positive, the "common residue" and the remainder are the same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder and the divisor (basically, the "common residue" is the first positive modulo).
- Paramètres
-
- Renvoie
- array{PHP32, PHP32}
Références PHP\divideHelper().
◆ equals()
Tests the equality of two numbers.
If you need to see if one number is greater than or less than another number, use BigInteger::compare()
- Paramètres
-
- Renvoie
- bool
Références value.
◆ extendedGCD()
◆ gcd()
Calculates the greatest common divisor
Say you have 693 and 609. The GCD is 21.
- Paramètres
-
- Renvoie
- PHP32
Références PHP32\extendedGCD().
◆ initialize()
◆ isValidEngine()
◆ max()
static max |
( |
PHP32 ... |
$nums | ) |
|
|
static |
Return the maximum BigInteger between an arbitrary number of BigIntegers.
- Paramètres
-
- Renvoie
- PHP32
◆ min()
static min |
( |
PHP32 ... |
$nums | ) |
|
|
static |
Return the minimum BigInteger between an arbitrary number of BigIntegers.
- Paramètres
-
- Renvoie
- PHP32
◆ modInverse()
Calculates modular inverses.
Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
- Paramètres
-
- Renvoie
- false|PHP32
Références $n.
◆ modPow()
◆ multiply()
◆ pow()
◆ powMod()
◆ randomRange()
◆ randomRangePrime()
static randomRangePrime |
( |
PHP32 |
$min, |
|
|
PHP32 |
$max |
|
) |
| |
|
static |
Generate a random prime number between a range
If there's not a prime within the given range, false will be returned.
- Paramètres
-
- Renvoie
- false|PHP32
◆ subtract()
◆ BASE
◆ BASE_FULL
const BASE_FULL = 0x4000000 |
◆ MAX10
MAX10 in greatest MAX10LEN satisfying MAX10 = 10**MAX10LEN <= 2**BASE.
◆ MAX10LEN
MAX10LEN in greatest MAX10LEN satisfying MAX10 = 10**MAX10LEN <= 2**BASE.
◆ MAX_DIGIT
const MAX_DIGIT = 0x3FFFFFF |
◆ MAX_DIGIT2
const MAX_DIGIT2 = 4503599627370496 |
◆ MSB
La documentation de cette classe a été générée à partir du fichier suivant :