()
| 368 | } |
| 369 | |
| 370 | negated(): BigDecimal { |
| 371 | if (this._special === SpecialValue.NAN) return this |
| 372 | if (this._special === SpecialValue.POSITIVE_INFINITY) { |
| 373 | return BigDecimal._create(0n, 0, SpecialValue.NEGATIVE_INFINITY, false) |
| 374 | } |
| 375 | if (this._special === SpecialValue.NEGATIVE_INFINITY) { |
| 376 | return BigDecimal._create(0n, 0, SpecialValue.POSITIVE_INFINITY, false) |
| 377 | } |
| 378 | if (this._mantissa === 0n) { |
| 379 | return BigDecimal._create(0n, 0, SpecialValue.NONE, !this._negativeZero) |
| 380 | } |
| 381 | return BigDecimal._create( |
| 382 | -this._mantissa, |
| 383 | this._exponent, |
| 384 | SpecialValue.NONE, |
| 385 | false |
| 386 | ) |
| 387 | } |
| 388 | |
| 389 | pow(n: number): BigDecimal { |
| 390 | if (this._special === SpecialValue.NAN) return this |
no test coverage detected