3 ms·
You don’t give up operator precedence, you just write it explicitly. Operator precedence is a consequence of implicit infix operator behavior. What is the val
by filoeleven 5y ago
You don’t give up operator precedence, you just write it explicitly. Operator precedence is a consequence of implicit infix operator behavior.
What is the value of this statement?
3 + 100 % 2 / 5
I’d like to have added a power calculation somewhere in there for illustration, but most general-purpose languages make that a function. It’s worth asking whether they ran out of infix symbols/syntax or chose a function for some other reason.
- owl57 5y agoProbably the former. Python seems fine with infix **. But Python doesn't have pointers: C++ designers would have to invent something less conventional (not that they aren't famous for unconventional horrors, though).