Socket
Socket
Sign inDemoInstall

@cosmjs/math

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmjs/math - npm Package Compare versions

Comparing version 0.22.2 to 0.22.3

14

build/decimal.js

@@ -117,2 +117,16 @@ "use strict";

}
/**
* a.minus(b) returns a-b.
*
* Both values need to have the same fractional digits.
* The resulting difference needs to be non-negative.
*/
minus(b) {
if (this.fractionalDigits !== b.fractionalDigits)
throw new Error("Fractional digits do not match");
const difference = this.data.atomics.sub(new bn_js_1.default(b.atomics));
if (difference.ltn(0))
throw new Error("Difference must not be negative");
return new Decimal(difference.toString(), this.fractionalDigits);
}
equals(b) {

@@ -119,0 +133,0 @@ return Decimal.compare(this, b) === 0;

4

package.json
{
"name": "@cosmjs/math",
"version": "0.22.2",
"version": "0.22.3",
"description": "Math helpers for blockchain projects",

@@ -50,3 +50,3 @@ "contributors": [

},
"gitHead": "56d635fc6a0986972bb5e9a57625838627c10c7d"
"gitHead": "ee205cc5f7b1154f2e8a5149092b19c82672b951"
}

@@ -27,2 +27,9 @@ /**

plus(b: Decimal): Decimal;
/**
* a.minus(b) returns a-b.
*
* Both values need to have the same fractional digits.
* The resulting difference needs to be non-negative.
*/
minus(b: Decimal): Decimal;
equals(b: Decimal): boolean;

@@ -29,0 +36,0 @@ isLessThan(b: Decimal): boolean;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc