{"name":"@formatjs/bigdecimal","version":"0.2.6","keywords":["bigdecimal","bigint","decimal","ecma402","i18n","intl"],"author":"Long Ho <holevietlong@gmail.com>","license":"MIT","_id":"@formatjs/bigdecimal@0.2.6","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":"2718cb8d4a37b3b426fd0bfdb097ea946375c0b3","tarball":"http://registry-npm.ywwl.com/@formatjs/bigdecimal/download/@formatjs/bigdecimal-0.2.6.tgz","fileCount":6,"integrity":"sha512-aPzKsGQOkQRHUEbyO/ZtYfr4EqaBQnSs6U4tzTla1xBnIdEHgY2GqEqso28UMwWRkzKqqTj5+/6BmuOsRkfn2A==","signatures":[{"sig":"MEUCIQDbOskJta5qn15vlRs5LQgKn3OsYS39lRcA4EF/mQIGYQIgG57k0z3XgX3cOKh7iK2bh0oTtZrv+mMObv1gH7WoTXk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@formatjs%2fbigdecimal@0.2.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54375,"size":11035,"noattachment":false,"key":"/@formatjs/bigdecimal/-/@formatjs/bigdecimal-0.2.6.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":"oidc:755dd2f3-fe8d-4c89-bb6c-4ef39152eb75"}},"repository":"formatjs/formatjs.git","description":"BigInt-backed decimal arithmetic for ECMA-402 polyfills","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bigdecimal_0.2.6_1780586597252_0.24920767147470313","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":1780586597402,"_cnpm_publish_time":1780586597402,"dist-tags":{"latest":"0.2.10"}}