Well that's the question, is there any programming language in which 2+3*5 is not 17? I found this question into an old test of my faculty and caught my attention. Is no big deal, but I was in doubt. A plus would be why not??
According to this page, Smalltalk will produce a different result:
in APL evaluation is strictly right to left, in Smalltalk it's strictly left to right
APL will get the right result by coincidence - it will get an unexpected value on 3*5+2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With