Home » excel » excel – Power operator inconsistency

excel – Power operator inconsistency

Posted by: admin April 23, 2020 Leave a comment

Questions:

I hope this won’t end as philosophical question, but which of theese is the right result of (2^5^2)

Excel:

enter image description here

Matlab:

enter image description here

Wolfram|Alpha: http://www.wolframalpha.com/input/?i=2%5E5%5E2

33554432

I know I can add braces to get desired behavior, but I want to know why those Math softwares are implementing it differently?

How to&Answers:

In MATLAB operators of equal precedence are always evaluated left to right which explain the result you are seeing. The same is true with Excel.
In essence they are assuming that operations are always left associative. Wolfram alpha, as well as Mathematica define exp. as right associative which afaik is more ‘correct’ mathematically. In doubt use parenthesis.