Exemplo n.º 1
0
 /**
  * @param Number $x
  *
  * @throws \DomainException
  *
  * @return \Cubiche\Domain\System\DecimalInfinite
  */
 protected function powSpecialCases(Number $x)
 {
     if ($x->isPositive()) {
         if ($this->isPositive()) {
             return $this;
         }
         if ($x->isInfinite()) {
             throw new \DomainException('The pow operation is not defined between "-INF" and "INF"');
         }
     } elseif ($x->isNegative()) {
         return Decimal::fromNative(0);
     }
     return;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function fromNative($value)
 {
     return Decimal::fromNative($value);
 }