{"name":"@formatjs/bigdecimal","version":"0.2.8","keywords":["bigdecimal","bigint","decimal","ecma402","i18n","intl"],"author":"Long Ho <holevietlong@gmail.com>","license":"MIT","_id":"@formatjs/bigdecimal@0.2.8","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":"a61a5814b5558d5e23e81ca3ceb48f992afa8593","tarball":"http://registry-npm.ywwl.com/@formatjs/bigdecimal/download/@formatjs/bigdecimal-0.2.8.tgz","fileCount":6,"integrity":"sha512-e/U8n09DJByWetRTG8pjNtNKOeW0T4efkFcceo72y0QAjyiP5egv97N6fSa2wKiTJHVydO8crTkTueF5bKuYjg==","signatures":[{"sig":"MEYCIQDNV5xDu4EzLSBtBgvcMgkvc8ZBb4R1T5O+9tVF/YEvngIhAKz8WanM/9vkJqrPIAOvVtHpwtDBJSC/faNYGloMwgPP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIAyCxsFsxfM1kSxMtOg22at3UuwOQVDEKHStMv7MdPGHAiAKYJWRcT5ZrhLITS9RrRjV5j0B4XepSbS3zGKTL/wp8w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@formatjs%2fbigdecimal@0.2.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":56884,"size":11677,"noattachment":false,"key":"/@formatjs/bigdecimal/-/@formatjs/bigdecimal-0.2.8.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.8_1793466646410_0.3155573345565772","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":1793466646508,"_cnpm_publish_time":1793466646508,"dist-tags":{"latest":"0.2.10"}}