Arithmetic with bc

Using command line as a calculator

$ echo "21 + 3 - (10 * 9)" | bc
OUTPUT-66

Scale Parameter

Use the scale parameter to determine precision of arithmetic output

$ echo "scale=3; (2*3)/36" | bc
OUTPUT.166

Interaction between ints and floats will return floats

$ echo "21 - 2.7" | bc
OUTPUT18.3