mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Prevent invalid invinite solutions in Numerical.solveQuadratic()
Closes #708
This commit is contained in:
parent
e3f04478d9
commit
ce41447793
1 changed files with 2 additions and 2 deletions
|
@ -181,7 +181,7 @@ var Numerical = new function() {
|
||||||
* If the discriminant is very small, we can try to pre-condition
|
* If the discriminant is very small, we can try to pre-condition
|
||||||
* the coefficients, so that we may get better accuracy
|
* the coefficients, so that we may get better accuracy
|
||||||
*/
|
*/
|
||||||
if (abs(D) < MACHINE_EPSILON) {
|
if (D !== 0 && abs(D) < MACHINE_EPSILON) {
|
||||||
// If the geometric mean of the coefficients is small enough
|
// If the geometric mean of the coefficients is small enough
|
||||||
var pow = Math.pow,
|
var pow = Math.pow,
|
||||||
gmC = pow(abs(a*b*c), 1/3);
|
gmC = pow(abs(a*b*c), 1/3);
|
||||||
|
|
Loading…
Reference in a new issue