perform floating point calculations in bash
May 1st, 2007 by Lawrence David
turns out floating point division (or any other type of floating point math) isn’t built-into the bash shell. instead, you’ll have to use the bc utility:
echo “6.0/10″ | bc -l
echo ’4*a(1)’ | bc -l
Thanks, it is working
$ echo ’4*a(1)’ | bc -l
3.14159265358979323844
$
Thanks you so much. Was delighted after seeing this.
Thanks you Jesus