News for hackers. Stuff that matters.
Re:Math.min(Math.max(num, min), max) by parliament32 on Thursday August 20, 2020 @12:19PM (#24224831)
I prefer "ceiling" and "floor", but yes, agreed.
Re:Math.min(Math.max(num, min), max) by gugagore on Thursday August 20, 2020 @12:30PM (#24224969)
Those also happen to be fairly common names for operations (rounding up or down to nearest integer).
Re:Math.min(Math.max(num, min), max) by KONAir on Thursday August 20, 2020 @12:37PM (#24225068)
I use ceil/floor (and make people use whenever I can) if something is going to happen when something hits the ceiling or drops to the floor. And avoid if it is just for clamping.