26 Jan
2008
26 Jan
'08
3:41 a.m.
On Jan 26, 2008 12:39 AM, Tom Johnson
Hi, I'm having some troubles with long.
from numpy import log log(8463186938969424928L) 43.5822574833 log(10454852688145851272L)
: 'long' object has no attribute 'log'
Numpy uses the standard C functions, so can't represent very large integers exactly. However, given the precision of the log function, it might be reasonable to truncate the digits and write the Python long as a float before conversion. That's what Python does. In [6]: import math In [7]: math.log(10454852688145851272L) Out[7]: 43.793597916587672 In [8]: float(10454852688145851272L) Out[8]: 1.045485268814585e+19 Chuck