Saturday, 15 September 2012

UNIX: Calculator

Calculator in UNIX:

bash -3.2$bc

typing 'bc' you will enter in calculator mode.
Now do any operations like 5*6 or 5+22 , etc press enter and the result will be shown.

If you do 11/2 , then the screen will show you 5 , it will not give results in decimal.

For viewing result in decimal , type
scale=2 
and now do any division , the result will be shown up to two places.

For coming out of the calculator mode , type 'quit' 
See the screen for more details.



No comments:

Post a Comment