It's possible to do with a switch statement as well (in C).
Edit: Would be nice if the original author of that code snippet threw in some parentheses for a little clarity with the operator precedence.
Edit: Would be nice if the original author of that code snippet threw in some parentheses for a little clarity with the operator precedence.
There are. With a funky calculation.
For example, taken from Rosetta C version:
You might say the calculations are hidden if/else, but well...