Ejemplo n.º 1
0
 public function testAdd()
 {
     parent::testAdd();
     $this->given($a = $this->fromNative($this->randomNativeNumber()), $b = $this->fromNative($this->randomNativeNumber()))->when($c = $a->add($b->toInteger()))->then->object($c)->isInstanceOf(Real::class);
 }
Ejemplo n.º 2
0
 public function testAdd()
 {
     parent::testAdd();
     $this->given($a = $this->fromNative($this->randomNativeNumber()), $b = $this->fromNative($this->randomNativeNumber()))->when($c = $a->add($b->toInteger()))->then->object($c)->isInstanceOf(Decimal::class);
     $this->given($positiveInfinite = $this->fromNative($this->positiveInfiniteNativeNumber()), $number = $this->fromNative($this->randomNativeNumber()))->then->boolean($positiveInfinite->addInteger($number->toInteger())->equals($positiveInfinite))->isTrue()->boolean($positiveInfinite->addReal($number->toReal())->equals($positiveInfinite))->isTrue()->boolean($positiveInfinite->addDecimal($number->toDecimal())->equals($positiveInfinite))->isTrue();
 }