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
A solution supporting all possible notations, including the scientific notation with both uppercase and lowercase exponents (e.g., 12.00e4):
12.00e4
if (( $(bc -l <<< "${value1/e/E} < ${value2/e/E}") )) then echo "$value1 is below $value2" fi