Better explanation of bc

This commit is contained in:
David Doblas Jiménez 2023-05-07 16:00:41 +02:00
parent 9499420af9
commit b6a9d83cf3

View File

@ -23,7 +23,7 @@ then
do do
grains_on_square=$(echo "2^($square-1)" | bc) grains_on_square=$(echo "2^($square-1)" | bc)
# use floating point arithmetic (bc) # use arbitrary precision arithmetic using basic calculator (bc)
total_grains=$(echo "$total_grains + $grains_on_square" | bc) total_grains=$(echo "$total_grains + $grains_on_square" | bc)
done done
echo $total_grains echo $total_grains