Message117470
| Author |
rhettinger |
| Recipients |
akira, mark.dickinson, rhettinger |
| Date |
2010年09月27日.20:28:26 |
| SpamBayes Score |
1.5538959e-11 |
| Marked as misclassified |
No |
| Message-id |
<1285619309.44.0.601633733763.issue9959@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It is not a reasonable request for math float functions to produce exact integer values and there is some harm in making further alterations to the existing algorithm (the more you tweak it in one place, the more you create oddities somewhere else).
There may be a case for a separate math.log2() function but this has never been requested before, so it is a low priority.
If the docs for bit_length() bug you, I can change them. They are meant to be the exact math definition of bit_length, not an executable exact result using limited precision floating point. Those docs are trying to inform users about bit_length() and are not making a promise about the behavior of math.log().
If you're wanting exact log results for integer inputs and bases, the math module is going to disappoint you no matter what we do. This is a limited-precision-floating-point fact of life. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年09月27日 20:28:29 | rhettinger | set | recipients:
+ rhettinger, mark.dickinson, akira |
| 2010年09月27日 20:28:29 | rhettinger | set | messageid: <1285619309.44.0.601633733763.issue9959@psf.upfronthosting.co.za> |
| 2010年09月27日 20:28:28 | rhettinger | link | issue9959 messages |
| 2010年09月27日 20:28:27 | rhettinger | create |
|