nicolewhite / algebra.js

Build, display, and solve algebraic equations.
http://algebra.js.org
MIT License
1.34k stars 111 forks source link

IE 11 throwing error in algebra.parse(...) #55

Closed zhegwood closed 8 years ago

zhegwood commented 8 years ago

This expression is throwing an error in IE 11:

var expression = algebra.parse("0.999717 + 0.000186113 x - 0.0000000635039 x^2 + 0.0000000000034886 x^3");

The error is:

TypeError: Object doesn't support property or method 'sign' at o.prototype.reduce (eval code:1:18792) at o.prototype.multiply (eval code:1:20018) at o.prototype.divide (eval code:1:20250) at Anonymous function (eval code:1:8920)

PlehXP commented 8 years ago

IE doesnt support the Math.sign method. you need to add the polyfill from here... https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign