The distributive property of multiplication tells me that 2(9+3) = 2(9)+2(3) = 18+6 = 24. It is a single expression. It could be 2(a+b) or 2(x+y). The entire expression must be dealt with before the expression is used in the remainder of the equation.
What places the multiplication above the division in precedence? According to the rules of precedence I learned, as well as all those I have been able to find online, they are equal and are processed left-to-right?
That is the crux of the discussion here, of course.
Fun, isn’t it?
“The entire expression must be dealt with before the expression is used in the remainder of the equation.”
Negative, GhostRider.
48/2(9+3)
The operations inside the parens are evaluated first to give 48/2*12
Because mult and div are of equal precedence, the problem is then evaluated from left to right: 24 * 12 = 288.
The original poster's question concerned a programmable calculator. Therefore other such calculators are worthy of examination, such as the well-known bc, "an arbitrary precision calculator" which yields the following:
bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 48 / 2 * (9 + 3) 288Much of the math in computing is derived from the C language where the Operator Precedence rules have been adopted by ANSI for several decades.
Wonderful, however this problem is: /2(9+3) = *1/2(9+3) = 4.5 +1.5 = 6. The division sign causes the factor to be "1/2", the multiplicative inverse of the value operated on, not "2"-as if there was only a simple multiplication sign. Note that the concept of multiplicative inverse allows for the commutative property to hold. Then 0.5*12*48 = 48*12*0.5 = 12*0.5*48 = 48*0.5*12 = 288.