Message195175
This is a very odd inconsistency in math.log behavior. That said, it is probably only a single bit imprecision at the end of the float result. Still, 10 == 10L so I'd expect math.log of both to give the same result.
oss/cpython/2.7:LOAS$ ./python
Python 2.7.5+ (2.7:395ac61ebe1a, Aug 14 2013, 07:11:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.log(10) - math.log(10L)
4.440892098500626e-16
>>> math.log(10)
2.302585092994046
>>> math.log(10L)
2.3025850929940455
>>>
In Python 3.3 things seem fine and match the int behavior from 2.7 above despite the internal number implementation being a PyLong in 3.x:
>>> math.log(10)
2.302585092994046 |
|
Date |
User |
Action |
Args |
2013-08-14 15:04:47 | gregory.p.smith | set | recipients:
+ gregory.p.smith |
2013-08-14 15:04:47 | gregory.p.smith | set | messageid: <1376492687.31.0.627121997874.issue18739@psf.upfronthosting.co.za> |
2013-08-14 15:04:47 | gregory.p.smith | link | issue18739 messages |
2013-08-14 15:04:47 | gregory.p.smith | create | |
|