This hint requires the Developer Tools, which, of course, everyone has :). See, my problem with Apple's brain-dead Calculator application is that floating point invariably gets converted to integer (it used to anyway, now this is fixed in 10.3.5). Well, okay ... you can use still use gdb as an unlimited (sorta) precision calculator! Gotta do it in the Terminal, though. Here's how:

% gdb
...
(gdb) p 3.141579 * 2
$1 = 6.2831580000000002
(gdb) q

The p character stands for "print," meaning print the results of the equation. Okay, so maybe the amount of precision is overkill, but it's better than no precision at all! You can also use previous results in further equations. See that rather archaic $1 in the result there? Well, in a different
equation (in the same gdb session, of course), you can type that $1, and it will substitute the calculated value. For example:

Oh, yeah, that would have been useful. I ended up using Mathematica to calculate e to the appropriate number of places and then wrote a python script to solve the problem (later I re-wrote the python script in Mathematica itself)

Using the gnu debugger as a high-precision calculator
Authored by: recusant on Oct 22, '04 08:18:02PM

The question here really is why is any software company shipping a calculator desktop app that isn't using arbitrary precision algorithms.

Apple, you had an excuse when you were shipping 1MHz 6502 based machines. Any machine made in the last ten years can stand up to using an arbitrary precision engine in a calculator app.

So here's the question: Calculator has an executable called "CalcEngine" in the resource bundle. It appears to take algebraic calculations from stdin and write the answers to stdout. Anyone up to the challenge of figuring out the expected symbols and notation to creating a wrapper to bc or calc to replace Calculator.app's rather inferior brains? :-)

Ok, so I moved CalcEngine to CalcEngine.backup and created a symbolic link to bc called CalcEngine to see how badly it would break.

It mostly works in the Basic view, but many of the functions aren't recognized in the Advanced view. Looks like a job for sed, but it would be a lot easier with some info on the CalcEngine program itself. It also won't recognize decimals (sets the precision to 0)

Don't forget to put the original CalcEngine back if you do this experiment.

Using the gnu debugger as a high-precision calculator
Authored by: Carnildo on Oct 25, '04 05:45:50PM

CalcEngine seems to be a more powerful calculator than the Calculator.app frontend -- it has support for such things as variables and full infix notation. Also, using "strings" on it gives some interesting results:

Do man awk to see what is possible.
Note that you don't have to escape special characters, which is why
the alias looks more complex than you'd expect. Make sure your
bash version has that property too.