{"name":"@formatjs/bigdecimal","version":"0.2.9","keywords":["bigdecimal","bigint","decimal","ecma402","i18n","intl"],"author":"Long Ho <holevietlong@gmail.com>","license":"MIT","_id":"@formatjs/bigdecimal@0.2.9","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":"https://github.com/formatjs/formatjs/issues","dist":{"shasum":"bd1157ee129e173c8fa9599ac5b97c41623d0b7e","tarball":"http://registry-npm.ywwl.com/@formatjs/bigdecimal/download/@formatjs/bigdecimal-0.2.9.tgz","fileCount":6,"integrity":"sha512-rV5U95Koz9LADq080OdPOLy629Z1HNaid3842EORxm+0Q7QhvUalH7rgVAK3Zsa9pbmNvac/mNmkP7+xf8wYwg==","signatures":[{"sig":"MEYCIQCAe2iXamYB5w2kvDI2x1RaGzTl65fOqDsqkkVXXu3sewIhAMlFBnXOnjtund0Gmd38M2LuLdvJzc4V35QL/AAa01/E","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIHApmWEsbdLWcrhIyTxyulvu/dnCx2rVD3eZWPFcTCn6AiBnnTTwfm8AXr7yTJ9A0vJWgcV+BlXDigqSjtY2wyfsiQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@formatjs%2fbigdecimal@0.2.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":57268,"size":11800,"noattachment":false,"key":"/@formatjs/bigdecimal/-/@formatjs/bigdecimal-0.2.9.tgz"},"type":"module","types":"index.d.ts","exports":{".":"./index.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"755dd2f3-fe8d-4c89-bb6c-4ef39152eb75"}},"repository":{"url":"formatjs/formatjs.git","type":"git"},"description":"BigInt-backed decimal arithmetic for ECMA-402 polyfills","directories":{},"sideEffects":false,"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bigdecimal_0.2.9_1793483439654_0.8674827645128186","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":1793483439721,"_cnpm_publish_time":1793483439721,"dist-tags":{"latest":"0.2.10"}}