* Construct a BigDecimal WITHOUT normalizing (trailing zeros not stripped). * The result may violate the normalized-uniqueness invariant, so it must be * consumed only by an operation that re-normalizes its own output (e.g. * `toPrecision`, which rounds and then calls `fromRaw`). Used by `div` to
(sig: bigint, exp: number)
| 1410 | * @internal |
| 1411 | */ |
| 1412 | function rawUnnormalized(sig: bigint, exp: number): BigDecimal { |
| 1413 | const bd = Object.create(BigDecimal.prototype) as BigDecimal; |
| 1414 | (bd as { significand: bigint }).significand = sig; |
| 1415 | (bd as { exponent: number }).exponent = exp; |
| 1416 | return bd; |
| 1417 | } |
| 1418 | |
| 1419 | /** |
| 1420 | * Round a magnitude `mant · 10^exp` (mant ≥ 0) to `prec` significant digits. |
no outgoing calls
no test coverage detected