2 + 5x = 2+5x
x^2 = x**2
2x = 2*x, 3(4) = 3*(4)
* Asterisks indicates non-standard formations in mathematics such as
(5+2)8 instead of
8(5+2). These are (by choice) interpreted as multiplication.
runTests() from the browser console to prevent regressions.
Version 0.3 (24 Sep 2019): Switched to using
x**y for powers instead of
pow(x,y). This simplified code and resolved several edge cases that were not processed correctly (such as
(2+x)^3). The power operator has pretty broad browser support now. Also added a
cos) and constants (like
E) work out of the box.
Version 0.2.4 (Aug 2009): Replaced used of
var since only Mozilla recognizes it. Replaced
eval with better code.
Version 0.2.3 (Feb 2008): Added support for negative sign following caret. For example,
x^-2 = pow(x,-2). Note that negative sign preceding caret is not supported (by choice), i.e.
-x^2 = -(x^2) instead of
(-x)^2. This is in keeping with behavior of most hand-held graphing calculators.
Version 0.2.2: Bug fix regarding mishandling of constants and numbers preceding caret.
Version 0.2.1 (Apr 2007): Bug fixes: added implied multiplication for constant followed by number, stopped reserved constants
LOG10E from becoming
LOG10*E, fixed mishandling of constants and functions preceding caret.
Version 0.2 (Apr 2007): Addded support for use of caret sign ("^") as power operator.
Version 0.1 (Apr 2007): Added support for implied multiplication and removes white space.