Hacker News new | ask | show | jobs
by dsfuoi 3690 days ago
It looks easy but it isn't.

The second example causes unexpected behavior (and probably ub later) if: min + step > MIN_TYPE_MAX

The last example causes undefined behavior if: max - min < step - 1.