News for hackers. Stuff that matters.
Re:How many Java programmers does it take to round up to a p... by dhouston on Friday November 02, 2007 @04:16AM (#75382)
float precision issues make me nervous (although it's probably ok here), not to mention log() is kind of expensive compared to bit shifting

why not just something like

def fn(n): ret=1; while ret < n: ret <<= 1; return ret

(news.yc/browsers mangle whitespace; proper formatting is left as an exercise to the reader)

Re:How many Java programmers does it take to round up to a p... by Goladus on Friday November 02, 2007 @07:53AM (#75406)
To format code, add a whole bunch of returns and then indent 4-5 spaces

      (5 returns and 6 spaces later
          whitespace does what I want)
I think it's supposed to be 4 and 4, but I had some issues once and since then I just pile on returns and spaces until I get bored.
Re:How many Java programmers does it take to round up to a p... by nostrademons on Monday November 05, 2007 @09:59AM (#76277)
I thought it's 2 and 1:

 print 'Hello world'
Yup, that's it. A blank line before the indented block, then any amount of indentation.

Reddit is 2 and 4.