On Monday, 24 September 2018 at 12:56:43 UTC, JN wrote:
Awww, that's cute! Finding a remainder from division by 3
(three!) is junior school arithmetic. And in this case you
don't even need to properly calculate it, only guess that it's
not zero. I don't see a good excuse to fail at it.
Well, it requires you to know what a ternary operator is and
how it works. Also, how ints are implicitly converted to bool.
Also would be good to know if 13/3 is 4 or 4.33
Exactly and thank you JN. I help CS students at my uni and things
that seems trivial are sometimes hard for newbies.
And like you said, there are 2 things in that snippet besides the
math: Ternary and a implicit conversion to from int to bool.
Unfortunately skilled people may overlook this because it's
natural to them.
S.G.