Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaffle committed May 6, 2024
1 parent fbe46b3 commit 636c0b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 11 additions & 0 deletions BigDecimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,17 @@ if (BASE !== 2 || d >= 9007199254740992 || d <= -9007199254740992) {
BigDecimal.cmp = function (a, b) {
return compare(a, b);
};

BigDecimal.equal = function (a, b) {
return compare(a, b) === 0;
};
BigDecimal.lessThan = function (a, b) {
return compare(a, b) < 0;
};
BigDecimal.greaterThan = function (a, b) {
return compare(a, b) > 0;
};

BigDecimal.round = function (a, rounding) {
//TODO: quick round algorithm (?)
return round(a, rounding);
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yaffle/bigdecimal",
"version": "1.0.37",
"version": "2.0.0",
"description": "Arbitrary precision decimal arithmetic library. Polyfill for decimal proposal. Implemented on the top of BigInt.",
"main": "BigDecimal.js",
"types": "BigDecimal.d.ts",
Expand All @@ -20,19 +20,18 @@
],
"files": [
"BigDecimal.js",
"BigDecimalMath.js",
"BigDecimal.d.ts"
],
"author": "Viktor Mukhachev",
"license": "ISC",
"license": "$$$",
"bugs": {
"url": "https://github.com/Yaffle/BigDecimal/issues"
},
"homepage": "https://github.com/Yaffle/BigDecimal#readme",
"type": "module",
"devDependencies": {
"decimal.js": "^10.2.0"
},
"dependencies": {
"http-server": "^14.1.1"
}
}

0 comments on commit 636c0b5

Please sign in to comment.