Zend Framework
1.12
|
Public Member Functions | |
init ($operand, $base=10) | |
Initialise a big integer into an extension specific type. | |
add ($left_operand, $right_operand) | |
Adds two arbitrary precision numbers. | |
subtract ($left_operand, $right_operand) | |
compare ($left_operand, $right_operand) | |
Compare two big integers and returns result as an integer where 0 means both are identical, 1 that left_operand is larger, or -1 that right_operand is larger. | |
divide ($left_operand, $right_operand) | |
Divide two big integers and return result or NULL if the denominator is zero. | |
modulus ($left_operand, $modulus) | |
multiply ($left_operand, $right_operand) | |
pow ($left_operand, $right_operand) | |
powmod ($left_operand, $right_operand, $modulus) | |
sqrt ($operand) | |
binaryToInteger ($operand) | |
integerToBinary ($operand) | |
hexToDecimal ($operand) | |
public function integerToBinary($operand) { $return = ''; while(bccomp($operand, '0')) { $return . | |
add | ( | $left_operand, | |
$right_operand | |||
) |
Adds two arbitrary precision numbers.
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
binaryToInteger | ( | $operand | ) |
Implements Zend_Crypt_Math_BigInteger_Interface.
compare | ( | $left_operand, | |
$right_operand | |||
) |
Compare two big integers and returns result as an integer where 0 means both are identical, 1 that left_operand is larger, or -1 that right_operand is larger.
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
divide | ( | $left_operand, | |
$right_operand | |||
) |
Divide two big integers and return result or NULL if the denominator is zero.
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
hexToDecimal | ( | $operand | ) |
public function integerToBinary($operand) { $return = ''; while(bccomp($operand, '0')) { $return .
= chr(bcmod($operand, '256')); $operand = bcdiv($operand, '256'); } return $return; }
Implements Zend_Crypt_Math_BigInteger_Interface.
init | ( | $operand, | |
$base = 10 |
|||
) |
Initialise a big integer into an extension specific type.
This is not applicable to BCMath.
string | $operand | |
int | $base |
Implements Zend_Crypt_Math_BigInteger_Interface.
integerToBinary | ( | $operand | ) |
Implements Zend_Crypt_Math_BigInteger_Interface.
modulus | ( | $left_operand, | |
$modulus | |||
) |
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
multiply | ( | $left_operand, | |
$right_operand | |||
) |
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
pow | ( | $left_operand, | |
$right_operand | |||
) |
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
powmod | ( | $left_operand, | |
$right_operand, | |||
$modulus | |||
) |
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
sqrt | ( | $operand | ) |
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.
subtract | ( | $left_operand, | |
$right_operand | |||
) |
string | $left_operand | |
string | $right_operand |
Implements Zend_Crypt_Math_BigInteger_Interface.