Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use bc as an alternative...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use bc as an alternative...
Authored by: rmuir on Dec 31, '01 12:12:21PM
Included with in my OS X goodies is the all-too-common *nix inclusion of "bc" (/usr/bin/bc). It is available anytime at the command prompt. I remember this command as standing for "basic calculator".

Read about the bc command by typing "man bc"...

Here's a sample output:
[home1:~] rmuir% bc -q
scale=5
545+56
601
545-56
489
545*56
30520
545/56
9.73214
quit
[home1:~] rmuir%


Lots easier than adding an entry to your .cshrc file...


[ Reply to This | # ]
Use bc as an alternative...
Authored by: mudmonkey on Dec 31, '01 12:15:43PM

Aaaah, bc, how long has it been...

Don't forget 'dc' which is pretty much the same thing, but, reverse polish.

These commands are FAR more powerful than creating awk aliases to do simple arithmetic.



[ Reply to This | # ]
Use bc as an alternative...
Authored by: Paul Burney on Dec 31, '01 01:27:29PM

Of course, you could also add an alias:

alias bc "bc -q"

into your.cshrc file to save 60% in typing time. :-)



[ Reply to This | # ]