homepage

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 mark.dickinson
Recipients Alex.Rhatushnyak, mark.dickinson
Date 2013年05月12日.10:33:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1368354784.01.0.346172609972.issue17958@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry: this is not a bug, but a difficult-to-avoid consequence of floating-point imprecision: math.log(n, 2) is computed as log(n) / log(2), and each of the log computations and the division can introduce small errors.
For what it's worth, Python 3.3 has a `log2` function, which has accuracy that's a little bit better than math.log(n, 2), and gives the 'correct' answer exact powers of 2.
Closing as invalid.
History
Date User Action Args
2013年05月12日 10:33:04mark.dickinsonsetrecipients: + mark.dickinson, Alex.Rhatushnyak
2013年05月12日 10:33:04mark.dickinsonsetmessageid: <1368354784.01.0.346172609972.issue17958@psf.upfronthosting.co.za>
2013年05月12日 10:33:03mark.dickinsonlinkissue17958 messages
2013年05月12日 10:33:03mark.dickinsoncreate

AltStyle によって変換されたページ (->オリジナル) /