# nefe/number-precision

🚀1K tiny & fast lib for doing addition, subtraction, multiplication and division operations precisely

Repository: https://github.com/nefe/number-precision
Canonical: https://ross.abutalabs.com/products/number-precision
Language: TypeScript
License Family: other
Topics: floating-point, number-converter, rounding-error
Last push: 2024-06-11T02:08:46+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3299, "days_push": 814, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4097, forks 322 (observed 2026-08-28T04:08:35.427096+00:00)

## What it is
A tiny (~1KB) TypeScript library for JavaScript that performs addition, subtraction, multiplication, and division with exact decimal precision, avoiding floating-point errors like 0.1 + 0.2 = 0.30000000000000004. It also provides number stripping and ratio-based rounding.

## Use cases
- fix 0.1 + 0.2 floating point errors in javascript
- precise decimal arithmetic for money calculations
- round 0.105 to 2 decimal places correctly
- avoid floating point precision bugs in frontend apps
- accurate multiplication like 0.362 * 100
- strip floating point noise from computed numbers

## When to choose
- you need exact decimal arithmetic in JavaScript without heavyweight dependencies
- bundle size matters and you only need basic arithmetic operations
- you're doing financial or pricing calculations in a web app

## When to avoid
- you need arbitrary-precision or big-number math beyond safe integer boundaries
- you need a full decimal type with configurable precision and scale
- your runtime isn't JavaScript/TypeScript

## Facets
- artifact type: library
- maturity: stable
- function: math, serialization
- domain: developer-tools, web-development
- platform: browser
- tags: floating-point, arithmetic, rounding-error, typescript, tiny-library, algorithms, nodejs, javascript

## Member repositories
- nefe/number-precision (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:35.427096+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:23:18.696450+00:00, confidence not recorded.
  - readme: https://github.com/nefe/number-precision (fetched 2026-08-28T04:08:35.427096+00:00, sha 168c91b1670f)
  - registry_npm: https://registry.npmjs.org/number-precision (fetched 2026-08-29T09:15:09.405045+00:00, sha 0fea445cf2c6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
