imagine-node
Advanced tools
Comparing version 1.0.4 to 1.0.5
10
index.js
@@ -402,2 +402,12 @@ const { PI } = Math; | ||
} | ||
static toString(complex, imaginary) { | ||
const _this = new Complex(complex, imaginary); | ||
if (!_this.i) return String(_this.r); | ||
if (!_this.r) return `${_this.i > 0 ? '' : '-'}${Math.abs(_this.i)}i`; | ||
if (_this.i === 1) return `${_this.r} + i`; | ||
if (_this.i === -1) return `${_this.r} - i`; | ||
return `${_this.r} ${_this.i > 0 ? '+' : '-'} ${Math.abs(_this.i)}i`; | ||
} | ||
}; |
{ | ||
"name": "imagine-node", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "node module to work with complex numbers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16705
357