bc command : tips & tricks

bc stands for bench calculator
Here are some examples of bc command :
a) addition
$ echo '57+43' | bc100

b) subtraction
$ echo '57-43' | bc14

c) multiplication
$ echo '57*43' | bc2451

scale
The scale variable determines the number of digits which follow the decimal point in your result. By default, the value of the scale variable is zero.

d) division
$ echo 'scale=25;57/43' | bc1.3255813953488372093023255

 
 

njoy the simplicity…….
©Victimizeit

Advertisements

About victimizeit
This is Atul.. working for IBM as a DataStage Developer. I may not be an expert on any particular DataStgae technology, but I'm sure I do know a few things about DB2, AIX, Unix, Windows, and DataBase. In this blog, I'll give out some tips on these subjects. If you find them useful, great, I'll be happy. Thanks for stopping by !!

What is your opinion ?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: