N Ngoc Hue New member Jan 12, 2022 #1 How do you do a floating point arithmetic in shell script? Answer For floating point arithmetic (where 3/2=1.5) bash awk “BEGIN {print 10/3}” (low precision) bash echo “10/3″|bc -l (high precision) fish math -s4 10/3. zsh* echo $((10./3))
How do you do a floating point arithmetic in shell script? Answer For floating point arithmetic (where 3/2=1.5) bash awk “BEGIN {print 10/3}” (low precision) bash echo “10/3″|bc -l (high precision) fish math -s4 10/3. zsh* echo $((10./3))