{"library":"decimal.js-light","type":"library","category":null,"description":"decimal.js-light is an arbitrary-precision Decimal type for JavaScript, currently at stable version 2.5.1. It is a 'light' version of the more comprehensive `decimal.js` library, specifically optimized for a smaller footprint (12.7 KB minified compared to `decimal.js`'s 32.1 KB). This reduction in size comes with specific tradeoffs: it does not support `NaN`, `Infinity`, or `-0` as legitimate values, nor does it handle numbers in bases other than 10. A key difference in behavior is its approach to rounding; arithmetic operations such as division are truncated at the required precision by default, unlike `decimal.js` where a global rounding mode can apply to such operations. Explicit rounding methods like `toDecimalPlaces` must be called to achieve rounded results. Furthermore, transcendental functions like `naturalExponential`, `naturalLogarithm`, `logarithm`, and `toPower` have a default precision limited to about 100 digits, which can be extended by configuring the `LN10` property. The library also distinguishes its internal `e` property (base 10000000 exponent) from the `exponent()` method (base 10 exponent). The project appears to be actively maintained, with regular updates. It provides TypeScript type declarations.","language":"javascript","status":"active","version":"2.5.1","tags":["javascript","arbitrary","precision","arithmetic","big","number","decimal","float","biginteger","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install decimal.js-light","imports":["var Decimal = require('decimal.js-light');","import Decimal from 'decimal.js-light';","import type { Decimal } from 'decimal.js-light';"]},{"cmd":"yarn add decimal.js-light","imports":[]},{"cmd":"pnpm add decimal.js-light","imports":[]}],"homepage":"https://mikemcl.github.io/decimal.js-light","github":"https://github.com/MikeMcl/decimal.js-light","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/decimal.js-light","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/decimal.js-light/compatibility"}}