I have two numbers in scientific notation and I want to do some comparison between them in an if statement in bash. While doing so, I am getting error like bwlow: E.g:
bash-4.2$ a=10e-12
bash-4.2$ b=12e-12
bash-4.2$ if (( a > b )); then r=1; else r=0; fi
bash: ((: 10e: value too great for base (error token is "10e")
The same problem doesn't arise if a and b are integers. I see problem with floating numbers to if I use the above statement. Is there a simple way by which I can do the comparison within if statement?