# Equation Converter 0.3.1

Converts equations from standard mathematical notation, to javascript notation.

## Capabilities

- Removes white space. For example
`2 + 5x = 2+5x`

- Supports use of the caret sign ("^") to indicate power. For example
`x^2 = x**2`

- Handles implied multiplication. For example
`2x = 2*x, 3(4) = 3*(4)`

- Right-parenthesis followed by left-parenthesis, number*, variable, function, or constant.
- Number followed by left-parenthesis, variable, function, or constant
- Variable followed by left-parenthesis, number*, variable, function, or constant
- Constant followed by left-parenthesis, number*, variable, function, or constant

* Asterisks indicates non-standard formations in mathematics such as `(5+2)8`

instead of `8(5+2)`

. These are (by choice) interpreted as multiplication.

## Version history

Version 0.3.1 (26 Sep 2019): Switched to Standard Javascript style for internal code. More explicit handling of math funtions, which now allows use of exponetial notation ("9e9" to mean "9*10^9"). Added a series of code tests that can be run using the command `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 `with(Math){}`

statement to the final Javascript notation, so that Math functions (like `sin()`

and `cos`

) and constants (like `PI`

and `E`

) work out of the box.

Version 0.2.4 (Aug 2009): Replaced used of `const`

with `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 `LOG2E`

and `LOG10E`

from becoming `LOG2*E`

and `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.

## Reference