PhilT wrote: fat mass = -98.42 + (4.15 * waist) - (0.082 * weight)
fat mass = -98.42 + (4.15 * (waist - 0.082)) * weight
fat mass = -98.42 + (4.15 * (waist - (0.082 * weight)))
your random application of surplus brackets broke the last two unfortunately. They are wrong. Only the first is correct.
I was taught you group into brackets the parts you want done first, with the innermost brackets calculated first and working outwards.
Without the brackets specified, they could be positioned anywhere as far as I'm concerned, hence giving examples of it with brackets in different possible positions.
Yes, in this quick example I actually missed a pair of brackets out on the second one, for my purposes it could be:
fat mass = -98.42 + ((4.15 * (waist - 0.082)) * weight)
or
fat mass = (-98.42 + ((4.15 * (waist - 0.082))) * weight
So let's assume a weight of say 65 and a waist of 80.
fat mass = -98.42 + (332) - (5.33)
result: 228.25
fat mass = -98.42 + ((4.15 * (79.918)) * 65)
result: 21459.4605
fat mass = (-98.42 + (4.15 * (79.918))) * 65
result: 15160.5805
fat mass = -98.42 + (4.15 * (80 - (5.33)))
result: 211.4605
Which is why to me the brackets make all the difference. I was never taught anything about multiplying and dividing first. Everything gets bracketed to determine the order, that's how I was taught. Apparently that's wrong, so thank you for teaching me something new today. It will certainly be helpful next time I'm given an equation without all those lovely brackets!
(and no, I don't know the gubbins of interpreters and CPUs or how they handle things)