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 gregory.p.smith
Recipients gregory.p.smith
Date 2013-08-14.15:04:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376492687.31.0.627121997874.issue18739@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2013-08-14 15:04:47gregory.p.smithsetrecipients: + gregory.p.smith
2013-08-14 15:04:47gregory.p.smithsetmessageid: <1376492687.31.0.627121997874.issue18739@psf.upfronthosting.co.za>
2013-08-14 15:04:47gregory.p.smithlinkissue18739 messages
2013-08-14 15:04:47gregory.p.smithcreate