FWIW, I don't think it can without assuming the input lies in a certain range.
Reply on news.ycombinator.com