OT: Order of Arithmetic calculations

Jul 11, 2025 Last reply: 1 year ago 22 Replies

I came across

formatting link



For those who don't do Farcebook it shows a Casio fx-991ex and a Smartphone calculating the formula:


6/2((1+2) (actually the divide symbol -:- which I can't do with old Free Agent)

The Casio gives the result as 1 The Smartphone gives the result as 9



So I checked my Smartphone which gave 9 as did both Libre Calc and Excel =6/2*(1+2). From what I learnt at school (and I did Advance Maths a looong time ago even though this is arithmetic) and would say the answer is 1.



So when did the sequence change from left to right rather than multiplication has precedence over division?



÷ Cut and paste it

Its an american thing

>

When I was at school in the 1980s we were taught BODMAS which was Brackets, Orders (or powers), Division, Multiplication, Addition, and Subtraction.

The kids of today seem to be taught PEMDAS which is Parentheses, Exponents, Multiplication and Division (from left to right), and Addition and Subtraction (from left to right)

Using BODMAS gives you 9 whereas PEMDAS gives you 1

So it seems its down to the D and M swapping places which then gives you the two answers of 1 vs 9.

Sometimes calculators give implied multiplication higher precendence that explict multiplication, so the implied * in 2(1+2) would get priority over the division where 2*(1+2) would not.

A Casion I just tried does that (fx-83GT CW).

But a Texas Instruments one I tried gives 9 for both! (TI-30XS) Multiview.

nib

You have mismatched brackets but it's still BODMAS (or USA - PEMDAS). Brackets first:

6/2*3 Then the division: 3*3 Then multiply 9

In computer programming it would be 1, as expressions in brackets are evaluated first.

In the current world where we have become the 51st State of America without any formal announcement anything goes :-(

Both multiplication and division are multiplicative operators and have the same precedence. That's not possible to represent in a handy acronym, but it means BODMAS and PEMDAS are the same.

C uses left to right ordering for multiplicative operators:

formatting link
But this one has been doing the rounds for years. It seems that some calculators use an 'implied scaling' rule so that when you write '1/2x' the

2 binds more tightly to the x than the '/'. That may be why 2(1+2) is being computed as 6.

There is even a wikipedia page about it:

formatting link
Theo

Starting with 6 / 2 (2+1)

PEMDAS and BODMAS tells me brackets first

so that becomes 6 / 2 x 3

Now BODMAS says divide 1st

so thats 3 x 3

then that becomes 9

Now PEMDAS tells me to multiply first so thats 6 / 6

That becomes 1......

But if its written in proper notation on paper as in

6 x 3 - 2

then its multply the 3 with the numerator whcih s 18 and then divide by the 2 giving 9.

I think the confusion is in how the equation is written:

as in 6 / 2 x 3

vs

6 x 3 - 2

The mathematician in me would say the bottom version is correct and thus the correct answer is 9 from a BODMAS point of view but PEMDAS seems to suggest a left to right working through the upper equation.....

The acronyms aren't to be read strictly left to right, they are:

(P)(E)(MD)(AS) (B)(O)(DM)(AS)

with grouped items having the same precedence, ie they're mean the same thing: (MD) and (DM) are the same. Therefore they have no bearing on this calculation.

But you're right that this ambiguity is because we're not writing this in mathematical notation and so the content of the denominator is ambiguous. The left to right and other rules are only necessary because of the limited notation - if this was written out properly it would be clear.

Theo

Are you suggesting that it shouldn't be evaluated to 6?

Just put the expression into Wolfram Alpha for the authoritative answer

formatting link

This is why, in programming and spreadsheets, you spray brackets around, some of them theoretically redundant, to make absolutely clear in what order *you* want things done, whatever fast ones the compiler/interpreter might pull.

A typical compiler will convert an expression to Reverse Polish Notation, pushing its current running total onto the stack when it encounters a new operator. Hence the 6/2 will be evaluated as a unit, and '3' pushed, then the bracket will open a new level of evaluation, the result of which will be pushed, then the * will act on the top two stack values.

If you really want 6 / (2 * ( 2 + 1 ) ) then that's how you write it.

It astonishes me how you can keep social media in a perpetual state of confusion with ambiguously formatted equations :-)

What did you key on the calculator?

If you key 6 / 2 * ( 1 + 2 ) you will get 9

If you key 6 / 2 ( 1 + 2 ) some calculators won't understand it, and some will treat it like an algebraic expression of the form 2x where x =

1+2 = 3

I was a long time ago then :-) (9 would be the more "correct" answer)

It didn't multiplication and division have equal precedence, so unless guided otherwise (brackets etc) you evaluate left to right)

so it would calculate 6 / 2 * 3 which is still 9

Try it for yourself, open a javascript console in your web browser (CTRL+SHIFT+J in most, and CTRL+SHIFT+K in firefox), and type:

6/2*(1+2)

It will evaluate as you type, and print 9 when you hit return.

Thanks. I'm now going to have to review all my financial spreadsheets!

I tried the inverse calculation in the spreadsheets =(2*(2+1)/6)^-1 and that did come out as 1.

Inverse == perverse

This really is all new to me in my 8th decade.

What gives that the right to be authoritative?

I'd have failed my 'O' level doing that.

Here you are, thanks:

6÷2(2+1)

Did we all have to agree with it? Is there an International Treaty?

No wonder they can't get their gallons right.

In the expression 6/2(1+2) with the left to right ordering, it shouldn't.

Theo

When I did maths at school (early 1960s) the mnemonic for calculation sequence was BODMAS (Brackets, Of, Divide, Multiply, Add, Subtract).

Your 6/2((1+2) has more open brackets than closing ones, so I am ignoring one of the opens and assuming it is a multiply: Brackets: 1+2=3 There is no Of Divide: 6/2=3 Multiply: 3*3=9 (The add and subtract took place under the Brackets stage)

If the extra bracket was supposed to be a divide rather than a multiply, then the answer would be Divide: 3/3=1 and there is no Multiply stage.

It's actually language dependent - not all computers think the same.

I still bear scars from APL over 40 years ago, which IIRC worked from the right.

Andy

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required