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
How about this? =D
VAL_TO_CHECK="1.00001" if [ $(awk '{printf($1 >= $2) ? 1 : 0}' <<<" $VAL_TO_CHECK 1 ") -eq 1 ] ; then echo "$VAL_TO_CHECK >= 1" else echo "$VAL_TO_CHECK < 1" fi