{"name":"@formatjs/bigdecimal","version":"0.1.0","keywords":["bigdecimal","bigint","decimal","ecma402","i18n","intl"],"author":{"name":"Long Ho","email":"holevietlong@gmail.com"},"license":"MIT","_id":"@formatjs/bigdecimal@0.1.0","maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"},{"name":"pyrocat","email":"dinglinjie+npm@gmail.com"}],"homepage":"https://github.com/formatjs/formatjs#readme","bugs":{"url":"https://github.com/formatjs/formatjs/issues"},"dist":{"shasum":"6d55ec204e388c17c0ec236a8ea549b43f839b16","tarball":"http://registry-npm.ywwl.com/@formatjs/bigdecimal/download/@formatjs/bigdecimal-0.1.0.tgz","fileCount":5,"integrity":"sha512-QGru2moSN/Yga6i5zZI2tWL3mHG/s9Ek/Q6MgXQxI6+jApns4KeDPp6r8ZEEVEQikbXYwQHJ/Y7ZfBoJY15/8A==","signatures":[{"sig":"MEQCIA2qYJJCLrfqcXEBLbU1DPImZO5JYbnPNAp4rJF2SwALAiBBCBDqwdBAC8tfplurdopc1z1iF71GzSyIzdsaMBQ9MQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23456,"size":5893,"noattachment":false,"key":"/@formatjs/bigdecimal/-/@formatjs/bigdecimal-0.1.0.tgz"},"type":"module","types":"index.d.ts","exports":{".":"./index.js"},"gitHead":"3e554b07e572cf99f0c5e39a858ec14323103365","_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"repository":{"url":"git+https://github.com/formatjs/formatjs.git","type":"git"},"_npmVersion":"11.6.2","description":"BigInt-backed decimal arithmetic for ECMA-402 polyfills","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bigdecimal_0.1.0_1773767173954_0.6738584288398908","host":"s3://npm-registry-packages-npm-production"},"readme":"# @formatjs/bigdecimal\n\nBigInt-backed decimal arithmetic library designed as a lightweight replacement for `decimal.js` in ECMA-402 polyfills.\n\n## Representation\n\nValues are represented as `mantissa × 10^exponent` where:\n\n- `mantissa` is a `bigint` (signed, normalized — no trailing zeros)\n- `exponent` is a `number` (integer scaling factor)\n- Special flags handle NaN, ±Infinity, and -0\n\nNormalization removes long runs of decimal zeros in eight-digit chunks, then handles the remaining digits. Arithmetic values and division precision stay unchanged.\n\n## API\n\nImplements the 27 methods used by `@formatjs/ecma402-abstract`:\n\n- **Arithmetic**: `times`, `div`, `plus`, `minus`, `mod`, `abs`, `negated`, `pow`, `floor`, `ceil`, `log`\n- **Comparison**: `eq`, `lessThan`, `greaterThan`, `lessThanOrEqualTo`, `greaterThanOrEqualTo`\n- **Queries**: `isZero`, `isNaN`, `isFinite`, `isNegative`, `isPositive`, `isInteger`\n- **Conversion**: `toNumber`, `toString`\n- **Static**: `BigDecimal.pow`, `BigDecimal.set`\n\nInternal arithmetic lazily retains powers of ten through `10^64` (at most 65\nBigInts). Larger powers remain uncached. Safe integer Number inputs skip string\nparsing; fractional/unsafe values retain their decimal-string representation.\n\n`toNumber()` converts unscaled integer coefficients directly from BigInt, with\nbinary64 rounding. Fractional/scaled values retain decimal-text conversion;\nNaN, infinities and signed zero keep their explicit handling.\n\nDivision by signed powers of ten shifts the exponent when scale arithmetic is\nsafe. Other divisors and unsafe exponents retain the 40-digit scaled division\npath. Signed zero and nonfinite values keep their existing handling.\n","publish_time":1773767174131,"_cnpm_publish_time":1773767174131,"dist-tags":{"latest":"0.2.10"}}