How do math functions read in Scripting


GUI.BeginGroup(Rect(2, 2, Screen.width/2 - 54 * slider, 26));

is different to this

GUI.BeginGroup(Rect(2, 2, (Screen.width/2 - 54) * (slider), 26));

My problem is that I see 2 things happening in (Screen.width/2 - 54).
I see a division and then a subtraction. Why does monodevelop first divide the screen in half and then subtract 54. if it first subtracted 54 from 2 and then divided we would get a difference width for the gui box. When I didn’t put () around slider it seemed like it was multiplying 54 by slider(which was a float = 100) and then subtracting that number(5400) from screenwidth/2.

It follows normal precedence rules, for example multiply/division are performed before addition/subtraction unless parenthetical influences it.