I am trying hard to compare two floating point numbers within a bash script. I have to variables, e.g.
let num1=3.17648e-22 let num2=1.5
No
num1=0.555 num2=2.555 if [ `echo "$num1>$num2"|bc` -eq 1 ]; then echo "$num1 is greater then $num2" else echo "$num2 is greater then $num1" fi