Arithmetic with floating point
问题 I have a very simple problem, i'm making a function that receives some floating point numbers and make a couple of operations with them at the beggining. Something like this: function x { A=$1 B=$2 # here i need a ratio, so i do, let's say.. sum=$(($A + $B)) C=$(($A / $sum)) [lots of code here] } The problem is that $1 and $2 are floating point numbers, or even if they're ints, the ratio it's very likely not to be an int, so i don't know how to operate them under bash. I tried with a bc pipe