|
|
Using the gnu debugger as a high-precision calculator
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? :-)
Replacing Calculator.app/CalcEngine with 'bc'
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.
Replacing Calculator.app/CalcEngine with 'bc'
oh how I wish I had left my computer up when I went to work this morning.
Using the gnu debugger as a high-precision calculator
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: |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.54 seconds |
|