Precedence of exponentiation

The set of functions from a set $X$ to a set $Y$ is denoted $Y^X$.

Now a question about precedence of operations:

Should I write $X^{(Y^Z)}$ or $X^{Y^Z}$ is enough?

-
Since there is a natural bijection between $(X^Y)^Z$ and $X^{(Y\times Z)}$, the precedence would normally be the one you give. Nonetheless, I would suggest spending the effort of adding the two parentheses to make it unambiguous (you can always explicitly state that you will use $X^{Y^Z}$ to denote $X^{(Y^Z)}$ once, and then use the former). –  Arturo Magidin Apr 7 '12 at 16:43
As a personal comment, I don't like the notation $Y^X$ because every time I see it I have to stop and think what is what. I would strongly favour the notation $X\to Y$, and then the set in your question would be $(Z\to Y)\to X$. –  Martin Argerami Apr 7 '12 at 19:19
–  Janus Troelsen Aug 24 '13 at 22:07

$2^{2^{2^2}}$ could equal 256 or 16536 depending on the order.