You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

bigdecimal.js

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bigdecimal.js - npm Package Compare versions

Comparing version
1.3.0
to
1.3.1
+13
-12
package.json
{
"name": "bigdecimal.js",
"version": "1.3.0",
"version": "1.3.1",
"description": "A BigDecimal implementation with native BigInts",
"exports": {
"import": "./lib/bigdecimal.mjs",
"require": "./lib/bigdecimal.js"
"require": "./lib/bigdecimal.js",
"types": "./lib/bigdecimal.d.ts"
},

@@ -63,19 +64,19 @@ "main": "lib/bigdecimal.js",

"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"benchmark": "^2.1.4",
"big.js": "^6.2.1",
"bigdecimal": "^0.6.1",
"bignumber.js": "^9.1.0",
"bignumber.js": "^9.1.2",
"chai": "^4.3",
"decimal.js": "^10.4.1",
"eslint": "^8.24.0",
"mocha": "^9.2.0",
"decimal.js": "^10.4.3",
"eslint": "^8.56.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"rimraf": "^5.0.5",
"source-map-support": "^0.5.21",
"ts-node": "^10.9.1",
"typedoc": "^0.23.15",
"typescript": "^4.8.4"
"ts-node": "^10.9.2",
"typedoc": "^0.25.7",
"typescript": "^5.3.3"
}
}
+20
-16

@@ -19,2 +19,6 @@ # BigDecimal.js

## Disadvantages
* This library's minified version is about 5 times larger than big.js's minified version. So the library is not small.
## Installation

@@ -100,14 +104,14 @@

* 16 GB Ram
* MacOS Monterey 12.4
* Update Date: September 30th 2022
* MacOS Sonoma 14.2.1
* Update Date: January 28th 2024
* Library versions used:
* big.js 6.2.1
* (this library) bigdecimal.js 1.2.0
* (this library) bigdecimal.js 1.3.1
* bigdecimal 0.6.1
* bignumber.js: 9.1.0
* decimal.js:10.4.1
* bignumber.js: 9.1.2
* decimal.js:10.4.3
* Each operation is run with fixed set of decimal numbers composed of both simple and complex numbers.
* Micro benchmark framework used is [benchmark](https://www.npmjs.com/package/benchmark). Check out [benchmarks folder](https://github.com/srknzl/bigdecimal.js/tree/main/benchmarks) for source code of benchmarks.
* For now, benchmarked the following operations, more operations will be added soon.
* For now, benchmarked the following operations, more operations will be added later.
* Operations per second(op/s):

@@ -117,12 +121,12 @@

| --- | --- | --- | --- | --- | --- |
| Constructor | 44,023 ( - ) | 38,837 (<span style="color:red">-12%</span>) | 42,904 (<span style="color:red">-3%</span>) | 42,332 (<span style="color:red">-4%</span>) | 2,867 (<span style="color:red">-93%</span>) |
| Add | 80,680 ( - ) | 18,565 (<span style="color:red">-77%</span>) | 102,628 (<span style="color:green">**+27%**</span>) | 60,988 (<span style="color:red">-24%</span>) | 89 (<span style="color:red">-100%</span>) |
| Subtract | 74,621 ( - ) | 18,297 (<span style="color:red">-75%</span>) | 97,269 (<span style="color:green">**+30%**</span>) | 56,907 (<span style="color:red">-24%</span>) | 89 (<span style="color:red">-100%</span>) |
| Multiply | 503,718 ( - ) | 33,486 (<span style="color:red">-93%</span>) | 27,603 (<span style="color:red">-95%</span>) | 81,700 (<span style="color:red">-84%</span>) | 2,720 (<span style="color:red">-99%</span>) |
| Divide | 15,352 ( - ) | 1,129 (<span style="color:red">-93%</span>) | 12,169 (<span style="color:red">-21%</span>) | 14,022 (<span style="color:red">-9%</span>) | 679 (<span style="color:red">-96%</span>) |
| Remainder | 9,557 ( - ) | 3,916 (<span style="color:red">-59%</span>) | 14,052 (<span style="color:green">**+47%**</span>) | 22,538 (<span style="color:green">**+136%**</span>) | 2,605 (<span style="color:red">-73%</span>) |
| Positive pow | 27,710 ( - ) | 25 (<span style="color:red">-100%</span>) | 121 (<span style="color:red">-100%</span>) | 3,685 (<span style="color:red">-87%</span>) | 6 (<span style="color:red">-100%</span>) |
| Negative pow | 4,783 ( - ) | 21 (<span style="color:red">-100%</span>) | 117 (<span style="color:red">-98%</span>) | 2,063 (<span style="color:red">-57%</span>) | 277 (<span style="color:red">-94%</span>) |
| Abs | 771,310 ( - ) | 1,329,070 (<span style="color:green">**+72%**</span>) | 904,043 (<span style="color:green">**+17%**</span>) | 339,619 (<span style="color:red">-56%</span>) | 13,737 (<span style="color:red">-98%</span>) |
| Compare | 536,627 ( - ) | 1,180,043 (<span style="color:green">**+120%**</span>) | 764,960 (<span style="color:green">**+43%**</span>) | 393,814 (<span style="color:red">-27%</span>) | 1,010,649 (<span style="color:green">**+88%**</span>) |
| Constructor | 43,962 ( - ) | 38,238 (<span style="color:red">-13%</span>) | 42,337 (<span style="color:red">-4%</span>) | 42,355 (<span style="color:red">-4%</span>) | 2,818 (<span style="color:red">-94%</span>) |
| Add | 80,569 ( - ) | 18,406 (<span style="color:red">-77%</span>) | 100,734 (<span style="color:green">**+25%**</span>) | 59,815 (<span style="color:red">-26%</span>) | 90 (<span style="color:red">-100%</span>) |
| Subtract | 73,518 ( - ) | 18,265 (<span style="color:red">-75%</span>) | 96,022 (<span style="color:green">**+31%**</span>) | 57,130 (<span style="color:red">-22%</span>) | 89 (<span style="color:red">-100%</span>) |
| Multiply | 493,291 ( - ) | 33,422 (<span style="color:red">-93%</span>) | 26,810 (<span style="color:red">-95%</span>) | 79,995 (<span style="color:red">-84%</span>) | 2,609 (<span style="color:red">-99%</span>) |
| Divide | 15,341 ( - ) | 1,129 (<span style="color:red">-93%</span>) | 11,721 (<span style="color:red">-24%</span>) | 13,301 (<span style="color:red">-13%</span>) | 645 (<span style="color:red">-96%</span>) |
| Remainder | 9,362 ( - ) | 3,816 (<span style="color:red">-59%</span>) | 13,470 (<span style="color:green">**+44%**</span>) | 21,952 (<span style="color:green">**+134%**</span>) | 2,445 (<span style="color:red">-74%</span>) |
| Positive pow | 27,403 ( - ) | 25 (<span style="color:red">-100%</span>) | 113 (<span style="color:red">-100%</span>) | 3,535 (<span style="color:red">-87%</span>) | 6 (<span style="color:red">-100%</span>) |
| Negative pow | 4,863 ( - ) | 21 (<span style="color:red">-100%</span>) | 109 (<span style="color:red">-98%</span>) | 1,970 (<span style="color:red">-59%</span>) | 264 (<span style="color:red">-95%</span>) |
| Abs | 782,251 ( - ) | 1,424,376 (<span style="color:green">**+82%**</span>) | 917,526 (<span style="color:green">**+17%**</span>) | 358,678 (<span style="color:red">-54%</span>) | 14,132 (<span style="color:red">-98%</span>) |
| Compare | 546,243 ( - ) | 1,216,388 (<span style="color:green">**+123%**</span>) | 783,432 (<span style="color:green">**+43%**</span>) | 417,873 (<span style="color:red">-24%</span>) | 990,187 (<span style="color:green">**+81%**</span>) |

@@ -129,0 +133,0 @@ [npm-image]: https://img.shields.io/npm/v/bigdecimal.js.svg

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display