Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash adding floats

#Just use following structure for summing up varibles:
sum=$((var1 + var2))
#For float numbers use next instruction:
sum=$(bc <<< $var1'+'$var2)
 
PREVIOUS NEXT
Tagged: #bash #adding #floats
ADD COMMENT
Topic
Name
6+5 =