| Hack: | Command Line Calculator | |
| Subject: | Your Missing the point && optimized version | |
| Date: | 2005-02-22 09:24:20 | |
| From: | AdamJacobMuller | |
|
While bc and others are great unix command line calculators, there is one thing that they can't do. Conversions. While bc is a fantastic application how long would it take you, using the command line, to tell me how man lbs are in 10 tons in bc? unless you know by heart that there are 2000 lbs per ton, google calculate is going to be faster. On that note, here is my optimized version of this script
I removed some things that had no place IMHO, The entire last line, what was the purpose of that? strip_tags is better and faster than str_replace. Ideally we would wrap this in a
Like i said, it's all IMHO so..... |
||
Showing messages 1 through 1 of 1.
| Showing messages 1 through 1 of 1. |




Try "24 bushels in pecks" and you'll get "9"...
the answer should be 96 US pecks.
Though maybe I copied it wrong...