26 #require_once 'Zend/Crypt/Math/BigInteger/Interface.php'; 62 public function add($left_operand, $right_operand)
64 return bcadd($left_operand, $right_operand);
74 public function subtract($left_operand, $right_operand)
76 return bcsub($left_operand, $right_operand);
88 public function compare($left_operand, $right_operand)
90 return bccomp($left_operand, $right_operand);
101 public function divide($left_operand, $right_operand)
103 return bcdiv($left_operand, $right_operand);
113 public function modulus($left_operand, $modulus)
115 return bcmod($left_operand, $modulus);
125 public function multiply($left_operand, $right_operand)
127 return bcmul($left_operand, $right_operand);
137 public function pow($left_operand, $right_operand)
139 return bcpow($left_operand, $right_operand);
151 public function powmod($left_operand, $right_operand, $modulus)
153 return bcpowmod($left_operand, $right_operand, $modulus);
164 return bcsqrt($operand);
174 while (strlen($operand)) {
175 $ord = ord(substr($operand, 0, 1));
177 $operand = substr($operand, 1);
188 $cmp = bccomp($operand, 0);
193 while (bccomp($operand, 0) > 0) {
194 $return = chr(bcmod($operand, 256)) . $return;
195 $operand = bcdiv($operand, 256);
197 if (ord($return[0]) > 127) {
198 $return =
"\0" . $return;
220 while(strlen($hex)) {
221 $hex = hexdec(substr($operand, 0, 4));
222 $dec = bcadd(bcmul($return, 65536), $hex);
223 $operand = substr($operand, 4);
compare($left_operand, $right_operand)
pow($left_operand, $right_operand)
integerToBinary($operand)
binaryToInteger($operand)
powmod($left_operand, $right_operand, $modulus)
add($left_operand, $right_operand)
multiply($left_operand, $right_operand)
modulus($left_operand, $modulus)
divide($left_operand, $right_operand)
subtract($left_operand, $right_operand)