Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function fromNative($value)
 {
     return Integer::fromNative($value);
 }
Example #2
0
 /**
  * @param int $value
  *
  * @return AutoIncrementId
  */
 public static function fromNative($value)
 {
     return new self(Integer::fromNative($value));
 }
Example #3
0
 public function testPow()
 {
     parent::testPow();
     $this->given($positiveInfinite = $this->fromNative($this->positiveInfiniteNativeNumber()), $negativeInfinite = $this->fromNative($this->negativeInfiniteNativeNumber()), $number = $this->fromNative($this->randomNativeNumber()), $negativeNumber = $this->fromNative($this->negativeNativeNumber()))->then->boolean($number->pow($positiveInfinite)->equals($positiveInfinite))->isTrue()->boolean($number->pow($negativeInfinite)->isZero())->isTrue()->boolean($positiveInfinite->pow($number)->equals($positiveInfinite))->isTrue()->boolean($positiveInfinite->pow($number->toInteger())->equals($positiveInfinite))->isTrue()->boolean($positiveInfinite->pow($number->toReal())->equals($positiveInfinite))->isTrue()->boolean($positiveInfinite->pow($negativeNumber)->isZero())->isTrue()->boolean($negativeInfinite->pow($negativeNumber)->isZero())->isTrue()->boolean($negativeInfinite->pow($number->toInteger()->mult(Integer::fromNative(2)))->equals($positiveInfinite))->isTrue()->boolean($negativeInfinite->pow($number->toInteger()->mult(Integer::fromNative(2))->inc())->equals($negativeInfinite))->isTrue();
 }