( mantissa: bigint, exponent: number )
| 9 | } |
| 10 | |
| 11 | function removeTrailingZeros( |
| 12 | mantissa: bigint, |
| 13 | exponent: number |
| 14 | ): [bigint, number] { |
| 15 | if (mantissa === 0n) return [0n, 0] |
| 16 | while (mantissa % 10n === 0n) { |
| 17 | mantissa /= 10n |
| 18 | exponent++ |
| 19 | } |
| 20 | return [mantissa, exponent] |
| 21 | } |
| 22 | |
| 23 | function bigintAbs(n: bigint): bigint { |
| 24 | return n < 0n ? -n : n |
no outgoing calls
no test coverage detected