Message189005
| 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:04 | mark.dickinson | set | recipients:
+ mark.dickinson, Alex.Rhatushnyak |
| 2013年05月12日 10:33:04 | mark.dickinson | set | messageid: <1368354784.01.0.346172609972.issue17958@psf.upfronthosting.co.za> |
| 2013年05月12日 10:33:03 | mark.dickinson | link | issue17958 messages |
| 2013年05月12日 10:33:03 | mark.dickinson | create |
|