Math minmaxclamp

poiru: does this work better?