JavaScript Calculator v2.0

Written by John Chesley - Jan 13, 2006

JavaScript Source can be found in calculator.js

Check out version 1 to compare and contrast.

Known Bugs

The usual rounding errors caused by the fact that the math is done by the computer in binary, and it converts to decimal. As long as you avoid irrational numbers like the square root of two (try squaring it) it seems to work great.

Parenthesis are a little goofy. You can't put another operator after the closing parenthesie, so any complex equation with parenthesis has to either multiply or the parenthesis have to be first.

If you enter a number and an operator, hit backspace, and try to enter a new operator, the new operator will replace the number you typed in. Quite an unfortunate bug; I will see about fixing it as soon as possible.

Fixes and New Features

Handles more complex expressions like 5 - 4 * (20 - 19.5), including order of operations and parentheses.

Cool Features that Might Appear

update: these probably won't appear, since I'm no longer bored in visual basic class (not in vb class at all, yaay) and don't need distraction

Memory

Your standard "Remember this number for later, calculator!" type functions.

Scientific/Graphing Mode

A complete TI-89 Emulator! (Probably involving a little server-side magic for graphing, so it won't all be in Javascript)

Customized Calc

A completely customizable calculator, allowing you to basically rewire the entire thing!

Tips

Helpful-- something to the tune of, "You could have done 2x4" after you do 2+2+2+2. Note that it is only after you need the tip that it is offered :)