/** * @param \Cubiche\Domain\System\Number $x * * @return \Cubiche\Domain\System\Number */ public function pow(Number $x) { return $x->invertedPow($this); }
/** * @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; }