3 ms·
> z = a > b ? c < d ? e : f : g ? h : i That's stylistically ugly but not hard to predict; at some point I had it beaten into my head that ternaries are always
by zbentley 8y ago
> z = a > b ? c < d ? e : f : g ? h : i
That's stylistically ugly but not hard to predict; at some point I had it beaten into my head that ternaries are always at the bottom of the single-character operator precedence stack (I really hope all languages stick to that). I'd expect most people to know this.
> z = a & b > c | d
That is harder to predict. I wouldn't expect most people to know this one without looking up a precedence list.
- pjmlp 8y agoIt gets better when you compile that C code as C++, as ?: has a different precedence level.