Numpy, uint64 and Big O notation.

Skip Montanaro skip.montanaro at gmail.com
Thu Oct 9 12:31:58 EDT 2014


(For future reference, when responding to answers, it's worthwhile to
continue to cc python-list.)

On Thu, Oct 9, 2014 at 11:12 AM, Marcos Schratzenstaller <
marksabbath at gmail.com> wrote:
> The numpy has a function which manipulate 64 bits integers, but I couldn't
> find a specific method to multiplicate this kind of objects can not be
> manipulated as the same way, so if python is using the correct function
> (assuning python is detecting the object, calling the correct function) it
> is not a problem, but, where can I find this deep information?

Marcos,

Yes, the builtin help() function serves as reasonable documentation in this
case:

>>> help(numpy.int64)
Help on class int64 in module numpy:

class int64(signedinteger, __builtin__.int)
 |  64-bit integer. Character code 'l'. Python int compatible.
 |
 |  Method resolution order:
 |      int64
 |      signedinteger
 |      integer
 |      number
 |      generic
 |      __builtin__.int
 |      __builtin__.object
 |
 |  Methods defined here:
...
 |  Methods inherited from generic:
 |
 |  __abs__(...)
 |      x.__abs__() <==> abs(x)
 |
 |  __add__(...)
 |      x.__add__(y) <==> x+y
...
 |  __mod__(...)
 |      x.__mod__(y) <==> x%y
 |
 |  __mul__(...)
 |      x.__mul__(y) <==> x*y
...

The __mul__ method implements multiplication. I don't know the specific
implementation in numpy, but it's probably little more than a thin wrapper
around x * y (with perhaps some type and overflow checking).

Skip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141009/c2e6f77c/attachment.html>


More information about the Python-list mailing list