node-dextrin - v0.1.0
    Preparing search index...

    Class export=

    DXN decimal ([0-9]+(.[0-9]+)?M) — exact fixed-point, stored as sign × unscaledValue × 10^exponent (unscaledValue a non-negative BigInt, exponent the scale). Hand-rolled rather than built on a decimal-arithmetic package (decimal.js et al.) to keep this project dependency-free, per its zero-runtime-dependency default — only parse/format/compare/equals are needed for v1, not full arithmetic.

    Equality/ordering compare sign/unscaledValue/exponent directly (the generic field-reflection default from equality.cjs), not normalized numeric value — mirrors DXNRational never auto-reducing: two representations of the same numeric value at different scales (1.10 vs 1.1) are distinct DXN values, matching the "exact fixed-point" precision DXN.md describes.

    Index
    • Parameters

      • sign: -1 | 1
      • unscaledValue: bigint

        non-negative.

      • exponent: number

      Returns export=

    dxnType: string
    exponent: number
    sign: -1 | 1
    unscaledValue: bigint
    • Returns number

      lossy for magnitude/precision beyond what Number can hold exactly — documented, not hidden.

    • Best-effort, explicitly lossy: a JS number is binary floating-point, so its exact decimal expansion is used, which may carry more (or differently rounded) digits than the value's "intended" decimal literal had — the same lossiness DXNDecimal#toNumber has, just in the other direction.

      Parameters

      • n: number

      Returns export=

    • Parameters

      • str: string

        [-]digits(.digits)?, no M suffix (that's .dxn text syntax, applied/stripped by the text codec, not here).

      Returns export=