Lines Matching refs:GTBigInteger

31 class GTBigInteger {  class
87 } else if ($value instanceof GTBigInteger) {
118 * @param GTBigInteger $integer the other GTBigInteger
121 public function comp(GTBigInteger $integer) {
128 * @param GTBigInteger $integer the other GTBigInteger
129 * @return GTBigInteger the sum of the two integers
131 public function add(GTBigInteger $integer) {
132 return new GTBigInteger(bcadd($this->value, $integer->value, 0));
138 * @param GTBigInteger $integer the GTBigInteger to subtract from this one
139 * @return GTBigInteger the result of the subtraction
141 public function sub(GTBigInteger $integer) {
142 return new GTBigInteger(bcsub($this->value, $integer->value, 0));
148 * @param GTBigInteger $integer the GTBigInteger to multiply with
149 * @return GTBigInteger the result of the multiplication
151 public function mul(GTBigInteger $integer) {
152 return new GTBigInteger(bcmul($this->value, $integer->value, 0));
158 * @param GTBigInteger $integer the GTBigInteger to divide by
159 * @return GTBigInteger the result of the division
161 public function div(GTBigInteger $integer) {
162 return new GTBigInteger(bcdiv($this->value, $integer->value, 0));
169 * @return GTBigInteger the modulus
172 return new GTBigInteger(bcmod($this->value, $modulus));
178 * @param GTBigInteger $integer power
179 * @return GTBigInteger result of raising this GTBigInteger to the power of another GTBigInteger
181 public function pow(GTBigInteger $integer) {
182 return new GTBigInteger(bcpow($this->value, $integer->value, 0));
189 * @return GTBigInteger this << $step
192 return new GTBigInteger(bcmul($this->value, bcpow(2, $step)));
199 * @return GTBigInteger this >> $step
202 return new GTBigInteger(bcdiv($this->value, bcpow(2, $step)));
208 * @param GTBigInteger $integer value to be OR'ed with this GTBigInteger
209 * @return GTBigInteger $this | $integer
211 public function bitOr(GTBigInteger $integer) {
227 return new GTBigInteger($result);
233 * @param GTBigInteger $integer value to be XOR'ed with this GTBigInteger
234 * @return GTBigInteger $this | $integer
236 public function bitXor(GTBigInteger $integer) {
252 return new GTBigInteger($result);
258 * @param GTBigInteger $integer value to be AND'ed with this GTBigInteger
259 * @return GTBigInteger $this & $integer
261 public function bitAnd(GTBigInteger $integer) {
277 return new GTBigInteger($result);
284 * @return GTBigInteger ~$this
294 return new GTBigInteger($result);
349 $int = new GTBigInteger($bytes);
350 $int = $int->add(new GTBigInteger(1));