/** * @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; }
/** * {@inheritdoc} */ protected function fromNative($value) { return Decimal::fromNative($value); }