David Grant wrote: > I am using numpy-0.9.8 and it seems that numpy's log2 function can't > handle large integers? > > In [19]: > a=11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 > > In [20]: math.log(a,2) > Out[20]: 292.48167544353294 > > In [21]: numpy.log2(a) >
Ufuncs on objects (like the long object) work by looking for the corresponding method. It's not found for long objects. Convert the long object to a float first. I'm not sure of any other way to "fix" it. I suppose if no method is found an attempt to convert them to floats could be performed under the covers on all object array inputs. -Travis ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion