OneNote not following correct parsing of mathematical operations

B

blackgorilla

Explained with Example

in OneNote type 2/2*2= and hit the space bar
the result is 0.5 when it should be actually 2. (2/2= 1, 1*2=2)

however it gives the correct result using the following syntax :
(2/2)*2 ie using the braces to make sure that OneNote performs the 2/2
operation first.

2/2*2 in Excel gives the correct answer.

Bug?
 
X

xTenn

Explained with Example

in OneNote type 2/2*2= and hit the space bar
the result is 0.5 when it should be actually 2. (2/2= 1, 1*2=2)

however it gives the correct result using the following syntax :
(2/2)*2 ie using the braces to make sure that OneNote performs the 2/2
operation first.

2/2*2 in Excel gives the correct answer.

Bug?


Am I the only one who fondly remembers mathematical order, when no others
are specified or cannot be guessed in fear of breaking unknown
quantitizations, to be (M)y (D)ear (A)unt (S)ally?

That is, without assuming an ordered precedence or grouping (which is not
specified by the above, especially considering that it is not RPN nor known
logical units), the order defaults to (M)ultiplication (D)ivision (A)ddition
(S)ubtraction. Otherwise assuming an order could be detrimental to given
units.

I digress, but I guess My Dear Aunt Sally is just not in Voque...
 
Y

YouBetcha

The "MDAS" mnemonic is correct, but it isn't a 1,2,3,4 order of those items.
It is Multiplication and Division, in order from left to right
Addition and Subtraction, in order from left to right.

You would not say "addition is before subtraction" and calculate 1-2+3 as
1-(2+3) = 1-5 = -4. You would calculate 1-2+3 = -1 +3 = 2. This is
completely parallel to saying "multiplication before division" and
calculating 2/2*2 as 2/(2*2) = 2/4 =1/2. You would calculate 2/2*2 = 1*2 =2.

Pull out any scientific calculator that knows order of operations, or open
Excel and try 2/2*2. You will get 2. :)
 
E

Erik Sojka (MVP)

You forgot to [P]lease less her ;)

..


Am I the only one who fondly remembers mathematical order, when no
others are specified or cannot be guessed in fear of breaking unknown
quantitizations, to be (M)y (D)ear (A)unt (S)ally?

That is, without assuming an ordered precedence or grouping (which is
not specified by the above, especially considering that it is not RPN
nor known logical units), the order defaults to (M)ultiplication
(D)ivision (A)ddition (S)ubtraction. Otherwise assuming an order
could be detrimental to given units.

I digress, but I guess My Dear Aunt Sally is just not in Voque...
 
Y

YouBetcha

If you are using Excel you have to use (N)ow (P)lease (B)less (M)y (D)ear
(A)unt (S(S)ally -- which I just made up -- because excel treats "negation"
as different from "subtraction," and it is prioritized over powers, which is
questionable.
So -5^2 does not equal 0-5^2 in excel. For some reason, they decided there
is an implied set of parenthesis around the -5 in the first, but not the
second.

You know, if you look at the layers of rules that Excel lists out, which
includes things like percent signs, boolean operators and concatenation, you
would really have trouble coming up a way to remember it all!

Not to get too sidetracked, though.

Erik Sojka (MVP) said:
You forgot to [P]lease less her ;)

..


Am I the only one who fondly remembers mathematical order, when no
others are specified or cannot be guessed in fear of breaking unknown
quantitizations, to be (M)y (D)ear (A)unt (S)ally?

That is, without assuming an ordered precedence or grouping (which is
not specified by the above, especially considering that it is not RPN
nor known logical units), the order defaults to (M)ultiplication
(D)ivision (A)ddition (S)ubtraction. Otherwise assuming an order
could be detrimental to given units.

I digress, but I guess My Dear Aunt Sally is just not in Voque...
 
L

Leo Bellew

The "MDAS" mnemonic is correct, but it isn't a 1,2,3,4 order of those items.
It is Multiplication and Division, in order from left to right
Addition and Subtraction, in order from left to right.

Yes, it's "My Dear" "Aunt Sally"
You would not say "addition is before subtraction" and calculate 1-2+3 as
1-(2+3) = 1-5 = -4. You would calculate 1-2+3 = -1 +3 = 2.

To elaborate further, there is no other option. The axioms of
arithmetic say the subtraction operator is the inverse of addition,
and the addition operator must commute, that is,

1-2 must be the same thing as 1+(-2) and
1+(-2)+3 must be the same as 3+(-2)+1, both must be 2

Any other interpretation would mean we could not do Algebra.
This is
completely parallel to saying "multiplication before division" and
calculating 2/2*2 as 2/(2*2) = 2/4 =1/2. You would calculate 2/2*2 = 1*2 =2.

Again, the division operator is the inverse of multiplication, and the
multiplication operator must commute, that is,

2/2 must be the same thing as 2*(1/2) and
2*(1/2)*2 must be the same as (1/2)*2*2, both must be 2

It makes sense when we look at the whole big picture.
Pull out any scientific calculator that knows order of operations, or open
Excel and try 2/2*2. You will get 2. :)

Strictly speaking, the order of left to right should make no
difference (assuming multiplications are done before addition) because
the addition operators must commute among themselves and the
multiplication operators must communite among themselves.

In practice, because the number of digits representing a number is
very finite, if you multiply two large numbers, you can loose a lot of
digits. If you then divide by a large number, you may get a less
accurate answer than if you divided one of the large numbers first.
 
X

xTenn

Erik Sojka (MVP) said:
You forgot to [P]lease less her ;)



Ah, Erik, you have just validated my primer math education. I was thinking I
was alone in a sea of Excel users. :)
 
X

xTenn

YouBetcha said:
The "MDAS" mnemonic is correct, but it isn't a 1,2,3,4 order of those
items.
It is Multiplication and Division, in order from left to right
Addition and Subtraction, in order from left to right.

You would not say "addition is before subtraction" and calculate 1-2+3 as
1-(2+3) = 1-5 = -4. You would calculate 1-2+3 = -1 +3 = 2. This is
completely parallel to saying "multiplication before division" and
calculating 2/2*2 as 2/(2*2) = 2/4 =1/2. You would calculate 2/2*2 = 1*2
=2.

Pull out any scientific calculator that knows order of operations, or open
Excel and try 2/2*2. You will get 2. :)

Please Excuse My Dear Aunt Sally, but I did mean that in a rather
lighthearted vein.

To continue this diatribe thread which is no doubt straying too far from
anything OneNote related but still relatively interesting, I have one final
statement.

To those people using Windows, whip out Windows calculator, make sure it is
in standard view, and enter the following:

3 + 2 * 5 =

You should get 25.

Now change the calulator view to Sceintific (view/scientific) and enter it
again:

3+ 2 * 5 =

You now get 13.

Interesting? No, not really, but it is a good reminder to leave calculator
in sceintific view. But to get this thread back on topic, OneNote rocks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top