News for hackers. Stuff that matters.
Re:The Toughest Developer Puzzle Ever by sharkbrainguy on Thursday July 02, 2009 @11:53PM (#685584)

  var round = function(number){
      var binary = number.toString(2);
      var hex = number.toString(16);
      var R = function(str){
          return /^10*$/.test(str);
      };
      return R(binary) && R(hex);
  };
That I wrote this just shows how special class I am... If a number is "round" in base-n that just means it's a power of n, and obviously all powers of 16 are also powers of 2.

There are no comments on this comment yet.