This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients gurnec, mark.dickinson, rhettinger, serhiy.storchaka, skip.montanaro
Date 2015-04-16.19:24:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429212287.76.0.420931930573.issue23974@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2015-04-16 19:24:47skip.montanarosetrecipients: + skip.montanaro, rhettinger, mark.dickinson, serhiy.storchaka, gurnec
2015-04-16 19:24:47skip.montanarosetmessageid: <1429212287.76.0.420931930573.issue23974@psf.upfronthosting.co.za>
2015-04-16 19:24:47skip.montanarolinkissue23974 messages
2015-04-16 19:24:47skip.montanarocreate