(x: Interval | IntervalResult)
| 418 | acc = prodExact(acc, sq, p) ? p : nextUp(p); |
| 419 | } |
| 420 | k = Math.floor(k / 2); |
| 421 | if (k > 0) { |
| 422 | const p = sq * sq; |
| 423 | sq = prodExact(sq, sq, p) ? p : nextUp(p); |
| 424 | } |
| 425 | } |
| 426 | return acc; |
| 427 | } |
| 428 | |
| 429 | /** A LOWER bound of `v^n`, by the same chain as `powChainUp` with every |
| 430 | * uncertified product moved one ulp down. An overflowed product answers |
| 431 | * `Number.MAX_VALUE`, which is below the true value it stands for. */ |
| 432 | function powChainDown(v: number, n: number): number { |
| 433 | let acc = 1; |
no test coverage detected