4 ms·
Another option would be x.clamp(min, max)
by cesarb 9y ago
Another option would be
x.clamp(min, max)
- geocar 9y agoSure, and another option would be for a range "class" to do the clamping: Range(min, max).clamp(x) but this turns to a conversation about syntax, and not about designing API so that we guide our users towards success.