mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Clean up Numerical code a bit.
This commit is contained in:
parent
f6f9d963eb
commit
00f1d5089f
1 changed files with 4 additions and 4 deletions
|
@ -121,7 +121,7 @@ var Numerical = new function() {
|
||||||
* Numerical.EPSILON.
|
* Numerical.EPSILON.
|
||||||
*/
|
*/
|
||||||
isZero: function(val) {
|
isZero: function(val) {
|
||||||
return abs(val) <= EPSILON;
|
return val >= -EPSILON && val <= EPSILON;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -212,8 +212,8 @@ var Numerical = new function() {
|
||||||
// We multiply with a factor to normalize the coefficients.
|
// We multiply with a factor to normalize the coefficients.
|
||||||
// The factor is just the nearest exponent of 10, big enough
|
// The factor is just the nearest exponent of 10, big enough
|
||||||
// to raise all the coefficients to nearly [-1, +1] range.
|
// to raise all the coefficients to nearly [-1, +1] range.
|
||||||
var mult = pow(10, abs(
|
var mult = pow(10,
|
||||||
Math.floor(Math.log(gmC) * Math.LOG10E)));
|
abs(Math.floor(Math.log(gmC) * Math.LOG10E)));
|
||||||
if (!isFinite(mult))
|
if (!isFinite(mult))
|
||||||
mult = 0;
|
mult = 0;
|
||||||
a *= mult;
|
a *= mult;
|
||||||
|
|
Loading…
Reference in a new issue