| @@ 269-290 (lines=22) @@ | ||
| 266 | /* |
|
| 267 | * Test isPositive. |
|
| 268 | */ |
|
| 269 | public function testIsPositive() |
|
| 270 | { |
|
| 271 | $this |
|
| 272 | ->given( |
|
| 273 | $native = $this->randomNativeNumber(), |
|
| 274 | $number = $this->fromNative($native) |
|
| 275 | ) |
|
| 276 | ->then |
|
| 277 | ->boolean($number->isPositive()) |
|
| 278 | ->isTrue() |
|
| 279 | ; |
|
| 280 | ||
| 281 | $this |
|
| 282 | ->given( |
|
| 283 | $native = $this->negativeNativeNumber(), |
|
| 284 | $number = $this->fromNative($native) |
|
| 285 | ) |
|
| 286 | ->then |
|
| 287 | ->boolean($number->isPositive()) |
|
| 288 | ->isFalse() |
|
| 289 | ; |
|
| 290 | } |
|
| 291 | ||
| 292 | /* |
|
| 293 | * Test isNegative. |
|
| @@ 295-316 (lines=22) @@ | ||
| 292 | /* |
|
| 293 | * Test isNegative. |
|
| 294 | */ |
|
| 295 | public function testIsNegative() |
|
| 296 | { |
|
| 297 | $this |
|
| 298 | ->given( |
|
| 299 | $native = $this->randomNativeNumber(), |
|
| 300 | $number = $this->fromNative($native) |
|
| 301 | ) |
|
| 302 | ->then |
|
| 303 | ->boolean($number->isNegative()) |
|
| 304 | ->isFalse() |
|
| 305 | ; |
|
| 306 | ||
| 307 | $this |
|
| 308 | ->given( |
|
| 309 | $native = $this->negativeNativeNumber(), |
|
| 310 | $number = $this->fromNative($native) |
|
| 311 | ) |
|
| 312 | ->then |
|
| 313 | ->boolean($number->isNegative()) |
|
| 314 | ->isTrue() |
|
| 315 | ; |
|
| 316 | } |
|
| 317 | ||
| 318 | /* |
|
| 319 | * Test isZero. |
|
| @@ 73-96 (lines=24) @@ | ||
| 70 | /* |
|
| 71 | * Test isInfinite. |
|
| 72 | */ |
|
| 73 | public function testIsInfinite() |
|
| 74 | { |
|
| 75 | parent::testIsInfinite(); |
|
| 76 | ||
| 77 | $this |
|
| 78 | ->given( |
|
| 79 | $positiveInfinite = $this->positiveInfiniteNativeNumber(), |
|
| 80 | $number = $this->fromNative($positiveInfinite) |
|
| 81 | ) |
|
| 82 | ->then |
|
| 83 | ->boolean($number->isInfinite()) |
|
| 84 | ->isTrue() |
|
| 85 | ; |
|
| 86 | ||
| 87 | $this |
|
| 88 | ->given( |
|
| 89 | $negativeInfinite = $this->negativeInfiniteNativeNumber(), |
|
| 90 | $number = $this->fromNative($negativeInfinite) |
|
| 91 | ) |
|
| 92 | ->then |
|
| 93 | ->boolean($number->isInfinite()) |
|
| 94 | ->isTrue() |
|
| 95 | ; |
|
| 96 | } |
|
| 97 | ||
| 98 | /* |
|
| 99 | * Test isPositive. |
|
| @@ 101-124 (lines=24) @@ | ||
| 98 | /* |
|
| 99 | * Test isPositive. |
|
| 100 | */ |
|
| 101 | public function testIsPositive() |
|
| 102 | { |
|
| 103 | parent::testIsPositive(); |
|
| 104 | ||
| 105 | $this |
|
| 106 | ->given( |
|
| 107 | $positiveInfinite = $this->positiveInfiniteNativeNumber(), |
|
| 108 | $number = $this->fromNative($positiveInfinite) |
|
| 109 | ) |
|
| 110 | ->then |
|
| 111 | ->boolean($number->isPositive()) |
|
| 112 | ->isTrue() |
|
| 113 | ; |
|
| 114 | ||
| 115 | $this |
|
| 116 | ->given( |
|
| 117 | $negativeInfinite = $this->negativeInfiniteNativeNumber(), |
|
| 118 | $number = $this->fromNative($negativeInfinite) |
|
| 119 | ) |
|
| 120 | ->then |
|
| 121 | ->boolean($number->isPositive()) |
|
| 122 | ->isFalse() |
|
| 123 | ; |
|
| 124 | } |
|
| 125 | ||
| 126 | /* |
|
| 127 | * Test isNegative. |
|
| @@ 129-152 (lines=24) @@ | ||
| 126 | /* |
|
| 127 | * Test isNegative. |
|
| 128 | */ |
|
| 129 | public function testIsNegative() |
|
| 130 | { |
|
| 131 | parent::testIsNegative(); |
|
| 132 | ||
| 133 | $this |
|
| 134 | ->given( |
|
| 135 | $positiveInfinite = $this->positiveInfiniteNativeNumber(), |
|
| 136 | $number = $this->fromNative($positiveInfinite) |
|
| 137 | ) |
|
| 138 | ->then |
|
| 139 | ->boolean($number->isNegative()) |
|
| 140 | ->isFalse() |
|
| 141 | ; |
|
| 142 | ||
| 143 | $this |
|
| 144 | ->given( |
|
| 145 | $negativeInfinite = $this->negativeInfiniteNativeNumber(), |
|
| 146 | $number = $this->fromNative($negativeInfinite) |
|
| 147 | ) |
|
| 148 | ->then |
|
| 149 | ->boolean($number->isNegative()) |
|
| 150 | ->isTrue() |
|
| 151 | ; |
|
| 152 | } |
|
| 153 | ||
| 154 | /* |
|
| 155 | * Test add. |
|