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)