Commit 603aed56 authored by Kyumin Kim's avatar Kyumin Kim Committed by Brian Brazil

nit: right associative example (#798)

`2 * 3 ^ 2` being equivalent to `2 * (3 ^ 2)` doesn't actually demonstrate that `^` is right associative. It just follows from operator precedence. The significance of right associativity is better exemplified by something of same precedence level as `^`.
parent 269bf409
...@@ -248,4 +248,4 @@ highest to lowest. ...@@ -248,4 +248,4 @@ highest to lowest.
Operators on the same precedence level are left-associative. For example, Operators on the same precedence level are left-associative. For example,
`2 * 3 % 2` is equivalent to `(2 * 3) % 2`. However `^` is right associative, `2 * 3 % 2` is equivalent to `(2 * 3) % 2`. However `^` is right associative,
so `2 * 3 ^ 2` is equivalent to `2 * (3 ^ 2)`. so `2 ^ 3 ^ 2` is equivalent to `2 ^ (3 ^ 2)`.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment