MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / rawUnnormalized

Function rawUnnormalized

src/big-decimal/big-decimal.ts:1412–1417  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

1410 * @internal
1411 */
1412function 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.

Callers 2

mulToPrecisionMethod · 0.85
divMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected