예제 #1
0
 public function testSub()
 {
     parent::testSub();
     $this->given($a = $this->fromNative($this->randomNativeNumber()), $b = $this->fromNative($this->randomNativeNumber()))->when($c = $a->sub($b->toInteger()))->then->object($c)->isInstanceOf(Real::class);
 }
예제 #2
0
 public function testSub()
 {
     parent::testSub();
     $this->given($a = $this->fromNative($this->randomNativeNumber()), $b = $this->fromNative($this->randomNativeNumber()))->when($c = $a->sub($b->toInteger()))->then->object($c)->isInstanceOf(Decimal::class);
     $this->given($positiveInfinite = $this->fromNative($this->positiveInfiniteNativeNumber()), $number = $this->fromNative($this->randomNativeNumber()))->then->boolean($positiveInfinite->subInteger($number->toInteger())->equals($positiveInfinite))->isTrue()->boolean($positiveInfinite->subReal($number->toReal())->equals($positiveInfinite))->isTrue()->boolean($positiveInfinite->subDecimal($number->toDecimal())->equals($positiveInfinite))->isTrue();
 }