bc stands for bench calculator
Here are some examples of bc command :
a) addition
b) subtraction
c) multiplication
$ echo '57+43' | bc
100
b) subtraction
$ echo '57-43' | bc
14
c) multiplication
$ echo '57*43' | bc
2451
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
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' | bc
1.3255813953488372093023255
No comments :
Post a Comment