Arithmetic with bc

Using command line as a calculator

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

Scale Parameter

Use the scale parameter to determine precision of arithmetic output

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

Interaction between ints and floats will return floats

$ echo "21 - 2.7" | bc
18.3