Content-Type: text/x-zim-wiki Wiki-Format: zim 0.4 Creation-Date: 2016-08-23T17:44:50+01:00 ====== multiplication ====== Created Tuesday 23 August 2016 This has some traps to watch out for. First, the asterisk which is used to mean 'multiply' is also used for expansion. So in the command the parentheses are needed, as usual. The quotes are optional as usual. However, if they are omitted then the asterisk must be escaped. (See below) Second, when working with floating point numbers, watch out for the number of decimal places expected in the answer. For example, to multiply 37.67 by 82.48 note that the full result will have four decimal places. (Each number has 2 dec pls. so add them, 2 + 2 equals 4. The full answer will have four dec pls) So echo (math "37.67 * 82.48") will result in 3107.02. This is correct to 2 dec pls but we need 4. To get this, make either number up to 4 dec pls by adding some zeros. echo (math "37.6700 * 82.48") will result in 3107.0216 (Either number can have the zeros added) If you do not bother with the quotes, then the asterisk must be escaped. echo (math 37.6700 \* 82.48) will work. If you omit the back slash before the asterisk, you will get an error message.