Content-Type: text/x-zim-wiki Wiki-Format: zim 0.4 Creation-Date: 2016-08-23T17:43:28+01:00 ====== division ====== Created Tuesday 23 August 2016 This is rather messy if needing decimals in the answer. echo (math "45 / 9") will give the answer as 5, as expected. However, echo (math "47 / 9) will also give 5 as the answer, because it is using integer arithmetic. Many suggestions on line, but the easiest way is to invoke bc directly. Here is an example echo (echo "scale=5; 37/13" | bc) This will give the answer 2.84615 This pattern will work for other calculations echo (echo "scale-5; sqrt(2)") will give 1.41421 It can also be used to put a value into a variable. set result (echo "scale=5; 27.36^3" | bc) echo $result 20480.86425