5 examples for bc

{{ score }}
  # use bc to do simple calculations
echo "(1+1+2)/3" |bc
        
{{ score }}
  # Make calculations with floating point
bc -l
        
{{ score }}
  # Do simple calculation
bc <<< 1+2
        
{{ score }}
  # Do simple subtraction
bc <<< "2 - 1"
        
{{ score }}
  # Store result of calculation in a variable
var1=$(echo $var2 + 30.4 | bc)