(TouchPad only)

Web Calculator

After having misplaced my TI-89 I was in need of a scientific calculator that could parse/evaluate expressions rather than simple stack-based ones (e.g., solar-powered ones) and I wanted simple graphing capabilities.

I wasn't able to find anything in the app-store or preware that looked like what I wanted so I made my own and I hope that others will find it as useful as I do.

I'm a C# developer by day and this is my first venture into webOS/Enyo development so I'm sure there will be bugs. If you're patient with me and let me know of any issues you find I promise I'll do my best (as my time allows) to fix them as well as slowly add new functionality.

Expression evaluator

The expression evaluation part of the calculator should be easy enough to figure out; you give it an expression an it'll evaluate it if possible. Some examples include:

3+4*2 -> 11 (notice that order of operations are observed)

4! -> 24

2^3 -> 8

sqrt(4) -> 2

Note that I also define 2 constants,eandpithat evaluate to exactly what you think they should. The rest of the evaluator should be easy enough to pick up with the exception of thesum()function: I wanted a way to compute summations so the arguments to this function seem a little odd at first. As an example, consider one of the many methods of approximating the natural constante: the sum of the quantity one divided by x factorial, with x from zero to (some upper bound.) This could be entered like:

sum(1/x!,x,0,10)

and will yield 2.7182818011463845

Note that the variable x in this case is arbitrary. I could do the same thing with the variable taco:

sum(1/taco!,taco,0,10)

Graphing

Switching into the graphing mode via the button up top will show an empty graph. Simply enter any function with x as the independent variable and hit the equals sign to see the graph. Simple as that. When many graphing calculators draw a function with a vertical asymptote such as 1/x or tan(x) they will accidentally draw a vertical line where the graph really shouldn't have one. I've made what I think to be a pretty good effort at avoiding these anomalies.

Conclusion

I'm releasing this for free and it will always be free, so feel free to use and distribute this as you like. I've attached some screenshots and the app is in the preware feeds.

Enjoy!

-Brett

Change log

1.0.0 - Initial release.

1.0.1 - (1) Fixed number parsing bug. Leading zeroes no longer required for decimal numbers. E.g., ".5" now parses correctly where before "0.5" was required. (2) Improved reporting of parse errors in history view.

1.1.0 - (1) Added support for entering numbers in scientific notation, e.g., 2E15. (2) Added ans() function to reference past results. This doubles as a sort of memory. (3) Added degree/radian selector for trigonometric functions.

1.1.1 - Enabled tapping on an item in the history list to have the appropriate 'ans(X)' value added to the input line.