News for hackers. Stuff that matters.
Re:Math.min(Math.max(num, min), max) by hanoz on Thursday August 20, 2020 @12:33PM (#24225006)

  There was a young coder whose hacks
  His manager often claimed lacked
  The requisite clarity
  For to clamp vars would he:
  Math.min(Math.max(number, min), max);
Re:Math.min(Math.max(num, min), max) by drbacon on Thursday August 20, 2020 @01:45PM (#24226127)

    @jaffathecake had a problem of truncation
    and posted to Twitter his calculation.
    The gist of his attack
    was min( max( num, min ), max)
    yet refused to add any annotation.