example/ivy/android: fix parens grouping example
The current example 2**(2+3) yields the same result as not using parenthesis. The "grouped differently" example should use (2**2)+3 so that it yields a different result. Change-Id: If5f63ec03adba4402c51822d6c13646a26384730 Reviewed-on: https://go-review.googlesource.com/14960 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
c58aba718c
commit
ca60936f19
|
@ -17,7 +17,7 @@
|
|||
# Binary operators operate on the item immediately to the left, and everything to the right.
|
||||
2*3+4 # Parsed as 2*(3+4), not the usual (2*3)+4.
|
||||
2**2+3 # 2**5, not (2**2) + 3
|
||||
2**(2+3) # Use parentheses if you need to group differently.
|
||||
(2**2)+3 # Use parentheses if you need to group differently.
|
||||
# Ivy can do rational arithmetic, so 1/3 is really 1/3, not 0.333....
|
||||
1/3
|
||||
1/3 + 4/5
|
||||
|
|
Loading…
Reference in New Issue