{"name":"@formatjs/bigdecimal","version":"0.2.3","keywords":["bigdecimal","bigint","decimal","ecma402","i18n","intl"],"author":{"name":"Long Ho","email":"holevietlong@gmail.com"},"license":"MIT","_id":"@formatjs/bigdecimal@0.2.3","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":"fb02d9527823c01450cc3df91e2a7a7006383a7a","tarball":"http://registry-npm.ywwl.com/@formatjs/bigdecimal/download/@formatjs/bigdecimal-0.2.3.tgz","fileCount":6,"integrity":"sha512-d7LpumdsbHueHdlVMos2yROIumyisUJNlFAk3PpN/5YcnXhWnkYmeiaQnOjqmmGx8BbaphoIyaF2CPus3cownw==","signatures":[{"sig":"MEUCIQD2D1CEN6wv69Fm/EApFUtUiKIrzasAkd1uUOURSC10oQIgWRVhtqGeTdetMI8h7sIG3DFRSYACY8IUvsaaYD4JBB8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@formatjs%2fbigdecimal@0.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":57398,"size":11356,"noattachment":false,"key":"/@formatjs/bigdecimal/-/@formatjs/bigdecimal-0.2.3.tgz"},"type":"module","_from":"file:formatjs-bigdecimal-0.2.3.tgz","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"}},"_resolved":"/tmp/54e4deab9e0c0d08564f8149e247ceb4/formatjs-bigdecimal-0.2.3.tgz","_integrity":"sha512-d7LpumdsbHueHdlVMos2yROIumyisUJNlFAk3PpN/5YcnXhWnkYmeiaQnOjqmmGx8BbaphoIyaF2CPus3cownw==","repository":{"url":"git+https://github.com/formatjs/formatjs.git","type":"git"},"_npmVersion":"11.11.0","description":"BigInt-backed decimal arithmetic for ECMA-402 polyfills","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bigdecimal_0.2.3_1778002758208_0.28800261278814876","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":1778002758349,"_cnpm_publish_time":1778002758349,"dist-tags":{"latest":"0.2.10"}}