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

rat.js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rat.js - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

.npmignore

22

index.js
// Generated by CoffeeScript 1.10.0
(function() {
var Rat, bigInt;
var Integer, Rat;
bigInt = require("big-integer");
Integer = require("./Integer");

@@ -15,4 +15,4 @@ Rat = (function() {

}
this.num = new bigInt(num);
this.denom = new bigInt(denom);
this.num = new Integer(num);
this.denom = new Integer(denom);
this.normalize();

@@ -27,17 +27,17 @@ }

if (this.num.isZero()) {
this.denom = new bigInt(1);
this.denom = new Integer(1);
return this;
}
if (!this.denom.isPositive()) {
this.num = bigInt.zero.minus(this.num);
this.denom = bigInt.zero.minus(this.denom);
this.num = Integer.zero.minus(this.num);
this.denom = Integer.zero.minus(this.denom);
return this.normalize();
}
if (!this.num.isPositive()) {
this.num = bigInt.zero.minus(this.num);
this.num = Integer.zero.minus(this.num);
this.normalize();
this.num = bigInt.zero.minus(this.num);
this.num = Integer.zero.minus(this.num);
return this;
}
g = bigInt.gcd(this.num, this.denom);
g = Integer.gcd(this.num, this.denom);
this.num = this.num.divide(g);

@@ -71,3 +71,3 @@ this.denom = this.denom.divide(g);

if (Y == null) {
return new Rat(bigInt.zero.minus(X.num), X.denom);
return new Rat(Integer.zero.minus(X.num), X.denom);
}

@@ -74,0 +74,0 @@ if (!(Y instanceof Rat)) {

{
"name": "rat.js",
"version": "1.0.0",
"version": "1.1.0",
"description": "Rational numbers (fractions) in JS, with +, -, *, and /",
"main": "index.js",
"dependencies": {
"big-integer": "^1.5.6"
"BigInt": "^5.5.3"
},

@@ -17,4 +17,4 @@ "devDependencies": {

"repository": {
"type": "git",
"url": "https://github.com/fraczak/rat.js.git"
"type": "git",
"url": "https://github.com/fraczak/rat.js.git"
},

@@ -21,0 +21,0 @@ "author": "Wojciech Fraczak <fraczak@gmail.com>",

Sorry, the diff of this file is not supported yet

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