Common Mistake With Left of Right Evaluation in Q
Since all expressions are evaluated from right to left, rearranging the numbers can lead to different results.
Addition and multiplication are commutative, but the order with which they are called during a Q evaluation might yield some counterintuitive outputs. For example:
1 + 2 * 4 /output 9
2 * 4 + 1 /output 10
Written by Dionysios Barmpoutis
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#