Dreams of the Ultimate Calculator

I have this recurring fantasy of programming the perfect calculator. I've found two or three very good ones:
  • Frink, is a Java based calculator that I've become very fond of. It nearly has it all:
    • Pros
      • Runs anywhere, including cell phones and other small devices that have Java.
      • Unit conversion including currencies, and timezones.
      • Unlimited precision, interval arithmetic, complex numbers.
      • Really fun tutorial.
    • Cons
      • Closed source.
      • Java ;-)
  • Qalculate!
    • Pros
      • Open Source
      • Auto complete as you type, pretty cool.
      • Pretty prints results, ex. sqrt(2) => √(2) or 2*3 => 2·3.
      • Notion of exact values and showing fractional values.
      • Weird numbers formats like Roman, Sexagesimal
      • Can create your own functions that has dialog boxes.
      • RPN, plotting, history
    • Cons
      • Too many menus buttons.
      • Not fun, a little dry.
      • Missing Brazilian Real for currency!
      • No timezones.
  • wxMaxima
    • Pros
      • Open source
      • Complete computer algebra system.
      • Plotting
    • Cons
      • No unit conversions
      • No timezone conversions
If I were to make a calculator what features would I have?:
  • Open Source
  • Written in Python with optional C++ packages for speed
  • Works on small devices that have Python (like the OLPC)
  • Command line only interface also available (like bc)
  • Numbers are stored as basic SI units and everything else is formatting. So, for example all angles would be stored and calculated in radians, but you can display the format Degrees° Minutes" Seconds ', or just Degress with decimal point. You can show large numbers grouped with commas (1,234,567) or with spaces (1234 5678) etc. - all part of formatting. This could allow for Celsius/Fahrenheit conversions since it's could just be a special formatting. This is different from other calculators which uses SI units to convert from one unit to the other but doesn't use units as 'formatting'. Perhaps it makes no real difference, or maybe it's just brilliant.
  • Numbers would be stored as arbitrary precision fractions with real and complex parts and as intervals (interval arithmetic). This means up to 6 arbitrary precision numbers per value (numerator/denominator * real/imaginary * low/high interval).
  • Use Python for any extra programming capabilities. This means that the language should be compatible with Python as much as possible, or if you use a subset it would be compatible. For example, it would be nice to allow both ^ and ** to mean the exponent, but if you are mixing with Python you'd have to use only **.
  • Editable history. As you enter values it is stored in a history which you can edit and all the calculations after will be recalculated. This is very useful if you a bunch of calculations and then your realize the results is incorrect, as you look at your history you see your mistake and you fix it, then all the other calculations are recalculated as if you had typed in the correct value the first time.
  • Time zones, and other date calculations (Frink does a good job here).
  • Currency calculations with historical currencies (Frink again).
  • Ability to add your own functions with a dialog explaining how it works. (Qalculate! is pretty good in this respect, but it could be more interesting by having more teaching material).
  • Support for many languages.
  • Intelligent formating. If it thinks you are doing currency calculations because you enter numbers like 1.25 and 1.10 then it will try to show the calculations with two decimal points. If you perform calculations with feet and inches it will try and give you the results as Feet Inches 1/4 inches, etc.. When it guesses the wrong formatting it should be easy to set it straight.
  • Entering *2 or +3 will know to do the equivalent of %*= or %+=, where % is used for the previous value.
  • Units and functions will know when they are not exact and will quietly use intervals when they aren't.
  • Common units of measure should be easily accessible, rare units should be at least available.
  • Your standard units can be set. Some units are not very precise, like gallon or cup and vary from place to place or historically. This may be a way around the problem of having uk_gallon, us_gallon, us_dry_gallon, etc. It would also be interesting to be able to set your location to ancient Rome and get common values shown in Cubits and in Roman numerals.
  • It will look at the calculation history and attempt substitutions of exact values if it can, so that sqrt(2)^2 should give 2 instead of 2.0000000000000001448 like it does in Frink.
  • Option to show repeated decimals with a line above. Ex. 1/3 could be shown as 0.3̅ or 1/7 as 0.1̅4̅2̅8̅5̅7̅
  • Some CAS like features, but probably not a full set.
  • It should be fun. You can easily get a very interesting history of a unit. You probably wouldn't have thought that the kilogram or the meter had such an interesting history, let alone a cubit, jansky or furkin. Browsing functions should be informative and easy to do without having to go forth an back to the menu each time. Having a Frink like manual would help immensely.
Perhaps when I retire I'll work on this one day, who knows.

Comments

Anonymous said…
I wish if i can share my list of open source portals here.
Jay

Popular posts from this blog

Shortest Sudoku solver in Python

Dot to Png

Seven Segment Display in Inkscape