fraction.js
Advanced tools
Comparing version 4.1.0 to 4.1.1
/** | ||
* @license Fraction.js v4.1.0 13/05/2021 | ||
* @license Fraction.js v4.1.1 23/05/2021 | ||
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/ | ||
@@ -588,2 +588,7 @@ * | ||
// Negative roots become complex | ||
// (-a/b)^(c/d) = x | ||
// <=> (-1)^(c/d) * (a/b)^(c/d) = x | ||
// <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x | ||
// <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula | ||
// From which follows that only for c=0 the root is non-complex | ||
if (this['s'] < C_ZERO) return null; | ||
@@ -596,3 +601,3 @@ | ||
// Exponentiate and take root for n and d individually | ||
var n = this['s']; | ||
var n = C_ONE; | ||
var d = C_ONE; | ||
@@ -599,0 +604,0 @@ for (var k in N) { |
/** | ||
* @license Fraction.js v4.1.0 13/05/2021 | ||
* @license Fraction.js v4.1.1 23/05/2021 | ||
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/ | ||
@@ -633,2 +633,7 @@ * | ||
// Negative roots become complex | ||
// (-a/b)^(c/d) = x | ||
// <=> (-1)^(c/d) * (a/b)^(c/d) = x | ||
// <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180° | ||
// <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index ) | ||
// From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case. | ||
if (this['s'] < 0) return null; | ||
@@ -641,3 +646,3 @@ | ||
// Exponentiate and take root for n and d individually | ||
var n = this['s']; | ||
var n = 1; | ||
var d = 1; | ||
@@ -644,0 +649,0 @@ for (var k in N) { |
/* | ||
Fraction.js v4.1.0 13/05/2021 | ||
Fraction.js v4.1.1 23/05/2021 | ||
https://www.xarg.org/2014/03/rational-numbers-in-javascript/ | ||
@@ -4,0 +4,0 @@ |
{ | ||
"name": "fraction.js", | ||
"title": "fraction.js", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"homepage": "http://www.xarg.org/2014/03/rational-numbers-in-javascript/", | ||
@@ -25,3 +25,3 @@ "bugs": "https://github.com/infusion/Fraction.js/issues", | ||
}, | ||
"license": "MIT OR GPL-2.0-or-later", | ||
"license": "MIT", | ||
"repository": { | ||
@@ -31,2 +31,6 @@ "type": "git", | ||
}, | ||
"funding": { | ||
"type": "patreon", | ||
"url": "https://www.patreon.com/infusion" | ||
}, | ||
"engines": { | ||
@@ -33,0 +37,0 @@ "node": "*" |
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
66812
0
100
1529