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

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)



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.


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.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: