@formatjs/bigdecimal
BigInt-backed decimal arithmetic for ECMA-402 polyfills
Last updated 23 days ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @formatjs/bigdecimal 
SYNC missed versions from official npm registry.

@formatjs/bigdecimal

BigInt-backed decimal arithmetic library designed as a lightweight replacement for decimal.js in ECMA-402 polyfills.

Representation

Values are represented as mantissa × 10^exponent where:

  • mantissa is a bigint (signed, normalized — no trailing zeros)
  • exponent is a number (integer scaling factor)
  • Special flags handle NaN, ±Infinity, and -0

API

Implements the 27 methods used by @formatjs/ecma402-abstract:

  • Arithmetic: times, div, plus, minus, mod, abs, negated, pow, floor, ceil, log
  • Comparison: eq, lessThan, greaterThan, lessThanOrEqualTo, greaterThanOrEqualTo
  • Queries: isZero, isNaN, isFinite, isNegative, isPositive, isInteger
  • Conversion: toNumber, toString
  • Static: BigDecimal.pow, BigDecimal.set

Current Tags

  • 0.2.0                                ...           latest (23 days ago)

2 Versions

  • 0.2.0                                ...           23 days ago
  • 0.1.0                                ...           24 days ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |