◆ __construct()
__construct |
( |
|
$x = 0 , |
|
|
|
$base = 10 |
|
) |
| |
◆ abs()
◆ add()
◆ between()
◆ bitwise_and()
◆ bitwise_leftShift()
bitwise_leftShift |
( |
|
$shift | ) |
|
◆ bitwise_or()
◆ bitwise_rightShift()
bitwise_rightShift |
( |
|
$shift | ) |
|
◆ 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 value.
Référencé par BCMath\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{static, static}
Références BCMath\normalize(), et value.
◆ 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()
Calculates the greatest common divisor and Bezout's identity.
Say you have 693 and 609. The GCD is 21. Bezout's identity states that there exist integers x and y such that 693*x + 609*y == 21. In point of fact, there are actually an infinite number of x and y combinations and which combination is returned is dependent upon which mode is in use. See Bezout's identity - Wikipedia for more information.
- Paramètres
-
- Renvoie
- array{gcd: static, x: static, y: static}
Références $b, $c, $n, $temp, Engine\$value, et BCMath\normalize().
◆ initialize()
◆ isNegative()
Is Negative?
- Renvoie
- bool
Références value.
◆ isOdd()
◆ isValidEngine()
◆ make_odd()
Make the current number odd
If the current number is odd it'll be unchanged. If it's even, one will be added to it.
- Voir également
- self::randomPrime()
Références BCMath\isOdd(), et value.
◆ max()
static max |
( |
BCMath ... |
$nums | ) |
|
|
static |
Return the maximum BigInteger between an arbitrary number of BigIntegers.
- Paramètres
-
- Renvoie
- BCMath
◆ min()
static min |
( |
BCMath ... |
$nums | ) |
|
|
static |
Return the minimum BigInteger between an arbitrary number of BigIntegers.
- Paramètres
-
- Renvoie
- BCMath
◆ 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|BCMath
Références $n.
◆ modPow()
◆ multiply()
◆ negate()
◆ normalize()
Normalize
Removes leading zeros and truncates (if necessary) to maintain the appropriate precision
- Paramètres
-
- Renvoie
- BCMath
Références Engine\$bitmask, Engine\$precision, et $result.
Référencé par BCMath\add(), BCMath\bitwise_leftShift(), BCMath\bitwise_rightShift(), BCMath\divide(), BCMath\extendedGCD(), BCMath\multiply(), BCMath\pow(), BuiltIn\powModHelper(), Base\powModHelper(), et BCMath\subtract().
◆ pow()
◆ powMod()
◆ powModInner()
◆ randomRange()
◆ randomRangePrime()
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|BCMath
◆ scan1divide()
static scan1divide |
( |
BCMath |
$r | ) |
|
|
static |
Scan for 1 and right shift by that amount
ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s));
- Paramètres
-
- Renvoie
- int
- Voir également
- self::isPrime()
Références $r.
◆ setBitmask()
static setBitmask |
( |
|
$bits | ) |
|
|
staticprotected |
Set Bitmask
- Paramètres
-
- Renvoie
- Engine
- Voir également
- self::setPrecision()
Références $temp, et class.
◆ subtract()
◆ testBit()
Tests if a bit is set
- Renvoie
- bool
Références value.
◆ testSmallPrimes()
Test the number against small primes.
- Voir également
- self::isPrime()
Références $r, Engine\$value, et value.
◆ toBytes()
toBytes |
( |
|
$twos_compliment = false | ) |
|
◆ toString()
◆ ENGINE_DIR
Engine Directory
- Voir également
- parent::setModExpEngine protected
◆ FAST_BITWISE
const FAST_BITWISE = false |
Can Bitwise operations be done fast?
- Voir également
- parent::bitwise_leftRotate()
-
parent::bitwise_rightRotate() protected
La documentation de cette classe a été générée à partir du fichier suivant :