Message241266
I'm completely unqualified to offer a concrete, expert opinion here, but it seems like defaulting _maxwidth to 1L<<52 should work. I have no idea of the resulting performance implications though.
>>> for bpf in (45, 46, 47, 48, 49, 50, 51, 52, 53):
... print bpf,
... print sum(randrange(2**53 * 2//3, _maxwidth=1L<<bpf) % 2 for i in xrange(1000000)) / 1000000.0,
... print sum(randrange(2**52 * 2//3, _maxwidth=1L<<bpf) % 2 for i in xrange(1000000)) / 1000000.0
...
45 0.499959 0.500144
46 0.501622 0.500371
47 0.500257 0.499692
48 0.499567 0.499942
49 0.499789 0.50028
50 0.499882 0.500488
51 0.500479 0.50006
52 0.500553 0.500234
53 0.33275 0.500296 |
|
Date |
User |
Action |
Args |
2015-04-16 19:24:47 | skip.montanaro | set | recipients:
+ skip.montanaro, rhettinger, mark.dickinson, serhiy.storchaka, gurnec |
2015-04-16 19:24:47 | skip.montanaro | set | messageid: <1429212287.76.0.420931930573.issue23974@psf.upfronthosting.co.za> |
2015-04-16 19:24:47 | skip.montanaro | link | issue23974 messages |
2015-04-16 19:24:47 | skip.montanaro | create | |
|