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

complex.js

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

complex.js - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

2

bower.json
{
"name": "complex.js",
"main": "complex.js",
"version": "2.0.2",
"version": "2.0.3",
"homepage": "https://github.com/infusion/Complex.js",

@@ -6,0 +6,0 @@ "description": "A complex number library",

/**
* @license Complex.js v2.0.2 11/02/2016
* @license Complex.js v2.0.3 11/02/2016
*

@@ -300,3 +300,3 @@ * Copyright (c) 2016, Robert Eisele (robert@xarg.org)

// Besides the addition/subtraction, this helps having a solution for rational Infinity
// Besides the addition/subtraction, this helps having a solution for real Infinity
if (P['im'] === 0 && this['im'] === 0) {

@@ -334,3 +334,3 @@ return new Complex(this['re'] * P['re'], 0);

} else {
// Divisor is rational
// Divisor is real
return new Complex(a / c, b / c);

@@ -379,2 +379,3 @@ }

// If the exponent is real
if (P['im'] === 0) {

@@ -386,3 +387,3 @@

} else if (a === 0) {
} else if (a === 0) { // If base is fully imaginary

@@ -1219,4 +1220,13 @@ switch (P['re'] % 4) {

*/
isNaN: function() {
'isNaN': function() {
return isNaN(this['re']) || isNaN(this['im']);
},
/**
* Checks if the given complex number is finite
*
* @returns {boolean}
*/
'isFinite': function() {
return isFinite(this['re']) && isFinite(this['im']);
}

@@ -1223,0 +1233,0 @@ };

/*
Complex.js v2.0.2 11/02/2016
Complex.js v2.0.3 11/02/2016

@@ -21,2 +21,2 @@ Copyright (c) 2016, Robert Eisele (robert@xarg.org)

a,Math.ceil(this.im*a)/a)},floor:function(a){a=Math.pow(10,a||0);return new d(Math.floor(this.re*a)/a,Math.floor(this.im*a)/a)},round:function(a){a=Math.pow(10,a||0);return new d(Math.round(this.re*a)/a,Math.round(this.im*a)/a)},equals:function(a,b){k(a,b);return Math.abs(e.re-this.re)<=d.EPSILON&&Math.abs(e.im-this.im)<=d.EPSILON},clone:function(){return new d(this.re,this.im)},toString:function(){var a=this.re,b=this.im,c="";if(isNaN(a)||isNaN(b))return"NaN";0!==a&&(c+=a);0!==b&&(0!==a?c+=0>b?" - ":
" + ":0>b&&(c+="-"),b=Math.abs(b),1!==b&&(c+=b),c+="i");return c?c:"0"},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)}};d.ZERO=new d(0,0);d.ONE=new d(1,0);d.I=new d(0,1);d.PI=new d(Math.PI,0);d.E=new d(Math.E,0);d.EPSILON=1E-16;"function"===typeof define&&define.amd?define([],function(){return d}):"object"===typeof exports?module.exports=d:n.Complex=d})(this);
" + ":0>b&&(c+="-"),b=Math.abs(b),1!==b&&(c+=b),c+="i");return c?c:"0"},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)}};d.ZERO=new d(0,0);d.ONE=new d(1,0);d.I=new d(0,1);d.PI=new d(Math.PI,0);d.E=new d(Math.E,0);d.EPSILON=1E-16;"function"===typeof define&&define.amd?define([],function(){return d}):"object"===typeof exports?module.exports=d:n.Complex=d})(this);

@@ -6,3 +6,3 @@ {

"title": "complex.js",
"version": "2.0.2",
"version": "2.0.3",
"description": "A complex number library",

@@ -9,0 +9,0 @@ "keywords": ["complex numbers", "math", "complex", "number", "calculus", "parser", "arithmetic"],

@@ -12,3 +12,3 @@ # Complex.js - ℂ in JavaSript

===
```js

@@ -138,2 +138,6 @@ var Complex = require('complex.js');

boolean isFinite()
---
Checks if the given number is finite
Complex clone()

@@ -140,0 +144,0 @@ ---

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