Ad
  • Custom User Avatar

    It's funny because this was actually pretty much my original answer, except that I didn't account for numbers less than zero.
    The error message wasn't very helpful, so I found myself jumping through hoops trying to figure out how to handle floating point inaccuracies.

  • Custom User Avatar

    While I belive this is a very clever answer, doesn't this kind of defeat the purpose of solving the problem?