Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

archi

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

archi - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

8

index.js

@@ -21,2 +21,10 @@ 'use strict';

ArchiNumber.prototype.mod = function (num) {
var num1 = +this;
var num2 = +num;
var factor = getMaxFactor(num1, num2);
return new ArchiNumber((num1 * factor) % (num2 * factor));
};
function getMaxFactor(num1, num2) {

@@ -23,0 +31,0 @@ return Math.max(getFactor(num1), getFactor(num2));

2

package.json
{
"name": "archi",
"version": "0.1.1",
"version": "0.1.2",
"description": "Easy math with decimals for Javascript",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -42,2 +42,3 @@ # +archi

- `.minus(num)`: current num - other num
- `.mod(num)`: current num % other num

@@ -44,0 +45,0 @@ ## License

@@ -23,7 +23,17 @@ 'use strict';

test('mod', function (t) {
t.equal(+calc(2).mod(2), 0);
t.equal(+calc(3).mod(2), 1);
t.equal(+calc(0.3).mod(0.2), 1);
t.equal(+calc(0.3).mod(0.1), 0);
t.end();
});
test('composed calc', function (t) {
t.equal(+calc(0.1).plus(0.2).minus(0.1), 0.2);
t.equal(+calc(0.1).plus(0.1).plus(0.1), 0.3);
t.equal(+calc(0.1).plus(0.1).mod(0.1), 0);
t.end();
});
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