Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

how do you convert infix to postfix in case of exponents?

is 2^3^2 in postfix

23^2^

or

232^^

quite confused on this. thanks.

is 2^3^2 in postfix

23^2^

or

232^^

quite confused on this. thanks.

>> 2^3^2

ans =

64

My HP calculator does postfix

23^2^ = 64

The two exponent operators have equal precedence, so you work left to right.

The Windows calculator, which enforces order of operations (at least, entering 2+3*4 results in 14, not 20) says 64.

TI calculators (and most others) use standard algrbraic operations.

HP and a few others use reverse polish notation which does operations in a different order if ( ) are not used.

or

232^^

On an HP calculator the last line would not work.

You use

2 enter

3 ^

2^

and the result is 64.

In your last line you have two operators in a row, which procedure does not work.

In your first line your notation is difficult in that you do not know whether you are dealing with 2 and 3 or 23. You could develop a computer program which would take care of this particular problem but you would still hve a problem with longer first numbers.

Two operators in a row is not a problem. You do have to use enter twice to terminate digit entry.

2

Enter

3

Enter

2

y^x Returns 8

Y^x Returns 64

23^2^

There are tons of converters on the web eg. http://webplaza.pt.lu/dostert/infixtopostfix.htm

2^3^5 = (2^3)^5 = 32768

2 3 ^ 5 ^ = 32768 on my HP-15C where the exponential function is y^x

5 3 2 ^ ^ = 32768 on the HP-35 where the exponential function is x^y

> is 2^3^2 in postfix

> 23^2^

> or

> 232^^

It depends on whether you have defined your exponent operator as left-associative or right-associative. I don't think there's any authoritative answer on this. Without defining your exponent operator as left-associative or right associative, a^b^c results in an ambiguous expression.

Take a look at http://mathworld.wolfram.com/ExponentLaws.html . Notice that there are no expressions like x^y^m. However, there is an expression like (x^m)^n.

i found these websites and a book saying that exponents are evaluated right to left.

http://www.reed.edu/~mcphailb/applets/calc/

http://www.qiksearch.com/javascripts/infix-postfix.htm

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.

2^3^2 = 2^(3^2) = 2^9 = 512

Therefore the second is correct.

mlmcc