News for hackers. Stuff that matters.
Re:Math.min(Math.max(num, min), max) by gre on Thursday August 20, 2020 @12:57PM (#24225448)
In Factor:

    : clamp ( x min max -- y ) [ max ] dip min ; inline
https://docs.factorcode.org/content/word-clamp,math.order.ht...
Re:Math.min(Math.max(num, min), max) by cjallen88 on Friday August 21, 2020 @04:53AM (#24233254)
For casual readers, `dip` pops the top of the stack, executes a quotation, then pushes the top of the stack back on.

So this pops the max value off the stack, applies the quoted `max` word to the x and min stack values, then pops the max value back on the stack and applies the `min` word to the result and the max.