| @@ 91-100 (lines=10) @@ | ||
| 88 | /** |
|
| 89 | * {@inheritdoc} |
|
| 90 | */ |
|
| 91 | public function add(Number $x) |
|
| 92 | { |
|
| 93 | if (!$x->isInfinite() || |
|
| 94 | ($this->isPositive() && $x->isPositive()) || |
|
| 95 | ($this->isNegative() && $x->isNegative())) { |
|
| 96 | return $this; |
|
| 97 | } |
|
| 98 | ||
| 99 | throw new \DomainException('The add operation is not defined between "INF" and "-INF"'); |
|
| 100 | } |
|
| 101 | ||
| 102 | /** |
|
| 103 | * {@inheritdoc} |
|
| @@ 129-138 (lines=10) @@ | ||
| 126 | /** |
|
| 127 | * {@inheritdoc} |
|
| 128 | */ |
|
| 129 | public function sub(Number $x) |
|
| 130 | { |
|
| 131 | if (!$x->isInfinite() || |
|
| 132 | ($this->isPositive() && $x->isNegative()) || |
|
| 133 | ($this->isNegative() && $x->isPositive())) { |
|
| 134 | return $this; |
|
| 135 | } |
|
| 136 | ||
| 137 | throw new \DomainException('The sub operation is not defined between "INF" and "INF"'); |
|
| 138 | } |
|
| 139 | ||
| 140 | /** |
|
| 141 | * {@inheritdoc} |
|