Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Don't send `start` and `end`; send `start` and `lengthOfInterval`. (Whether that's a good idea in a given API is another question.)


That trades "min <= max" with "min + interval <= MAXINTEGER":

  if(number < min) return min;
  else if(number < min + interval) return number; // "if(number < max)"
  else return min + interval; // "return max"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: