()
| 430 | } |
| 431 | |
| 432 | ceil(): BigDecimal { |
| 433 | if (this._special !== SpecialValue.NONE) return this |
| 434 | if (this._mantissa === 0n) return this |
| 435 | if (this._exponent >= 0) return this // already an integer |
| 436 | |
| 437 | const divisor = bigintPow10(-this._exponent) |
| 438 | const m = this._mantissa |
| 439 | let q = m / divisor |
| 440 | |
| 441 | // Ceil: round toward +infinity |
| 442 | // For positive numbers with remainder, add 1 |
| 443 | if (m > 0n && m % divisor !== 0n) { |
| 444 | q += 1n |
| 445 | } |
| 446 | |
| 447 | if (q === 0n) { |
| 448 | return BigDecimal._create(0n, 0, SpecialValue.NONE, false) |
| 449 | } |
| 450 | const [nm, ne] = removeTrailingZeros(q, 0) |
| 451 | return BigDecimal._create(nm, ne, SpecialValue.NONE, false) |
| 452 | } |
| 453 | |
| 454 | log(base: number): BigDecimal { |
| 455 | if (this._special === SpecialValue.NAN) return this |
no test coverage detected