Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '64-bit': 0.07; 'responding': 0.07; 'bits': 0.09; 'builtin': 0.09; 'implements': 0.09; 'inherited': 0.09; 'overflow': 0.09; 'wrapper': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'compatible.': 0.16; 'int64': 0.16; 'integer.': 0.16; 'integers,': 0.16; 'numpy': 0.16; 'subject:Big': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thu,': 0.19; '>>>': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; '>>>': 0.24; 'integer': 0.24; 'skip': 0.24; 'cc:2**0': 0.24; '>': 0.26; '(for': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'correct': 0.29; 'resolution': 0.29; 'am,': 0.29; 'character': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'information?': 0.31; 'class': 0.32; 'probably': 0.32; 'skip:_ 10': 0.34; 'objects': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'object,': 0.36; 'method': 0.36; 'generic': 0.38; 'little': 0.38; "couldn't": 0.39; 'future': 0.60; 'skip:\xc2 10': 0.60; 'here:': 0.62; 'kind': 0.63; '8bit%:10': 0.64; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'detecting': 0.84; 'order:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZU1vcASP92NcuNqMH9Pftxg23y3yjBQ+HHuve5V5bkI=; b=cABc2jBcX3K3WwTeS3sVvpdhRf/oWFB4VPfelBiY8EaN5YPtO61W4LNBFUkf/uwtp+ A2FY08O6KPvctsiktCUSJ2gQ5nXkGbLsz+SwXFYJw7Qy8SNPshPBIOmtiF9sjtezwFhj RWO+6O7AgqoYTXIisDpg848YoSX+6l4bN2nteZRQ2Td4YqAjBoEY911lYXWk/M+zSTpf UiLjZ6QtnzGeakq7+ta9hnE6/v9aNQjt5H4ifaDQz6a+J6PvE+w64fcl9V+2o3MBwQxc u6cb2K9TvfyeCpyQ9dQkOvAIVT3rwG/W+qjNZnXAxb67rZxB820RzgyPGz2cI0kbfQcC 6xQg== MIME-Version: 1.0 X-Received: by 10.50.8.1 with SMTP id n1mr28774900iga.24.1412872318432; Thu, 09 Oct 2014 09:31:58 -0700 (PDT) In-Reply-To: References: <4fca2ff7-ad35-4514-b142-d4330c137fdb@googlegroups.com> Date: Thu, 9 Oct 2014 11:31:58 -0500 Subject: Re: Numpy, uint64 and Big O notation. From: Skip Montanaro To: Marcos Schratzenstaller Content-Type: multipart/alternative; boundary=089e013cc450a73fa70504fff8f0 Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 94 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412872322 news.xs4all.nl 2953 [2001:888:2000:d::a6]:34950 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78903 --089e013cc450a73fa70504fff8f0 Content-Type: text/plain; charset=UTF-8 (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@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 --089e013cc450a73fa70504fff8f0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
(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@gmail.com> wrote:
> The numpy has a function = which manipulate 64 bits integers, but I couldn't
> find a specif= ic method to multiplicate this kind of objects can not be
> manipulat= ed as the same way, so if python is using the correct function
> (ass= uning python is detecting the object, calling the correct function) it
&= gt; is not a problem, but, where can I find this deep information?

M= arcos,

Yes, the builtin help() function serves as reasonable documen= tation in this case:

>>&= gt; help(numpy.int64)
Help on class int64 in module numpy:

class = int64(signedinteger, __builtin__.int)
=C2=A0| =C2=A064-bit integer. Char= acter code 'l'. Python int compatible.
=C2=A0| =C2=A0
=C2=A0|= =C2=A0Method resolution order:
=C2=A0| =C2=A0 =C2=A0 =C2=A0int64
=C2= =A0| =C2=A0 =C2=A0 =C2=A0signedinteger
=C2=A0| =C2=A0 =C2=A0 =C2=A0integ= er
=C2=A0| =C2=A0 =C2=A0 =C2=A0number
=C2=A0| =C2=A0 =C2=A0 =C2=A0gen= eric
=C2=A0| =C2=A0 =C2=A0 =C2=A0__builtin__.int
=C2=A0| =C2=A0 =C2= =A0 =C2=A0__builtin__.object
=C2=A0| =C2=A0
=C2=A0| =C2=A0Methods def= ined here:
...
=C2=A0| =C2=A0Methods inherited from generic:
=C2= =A0| =C2=A0
=C2=A0| =C2=A0__abs__(...)
=C2=A0| =C2=A0 =C2=A0 =C2=A0x.= __abs__() <=3D=3D> abs(x)
=C2=A0| =C2=A0
=C2=A0| =C2=A0__add__(= ...)
=C2=A0| =C2=A0 =C2=A0 =C2=A0x.__add__(y) <=3D=3D> x+y
...<= br>=C2=A0| =C2=A0__mod__(...)
=C2=A0| =C2=A0 =C2=A0 =C2=A0x.__mod__(y) &= lt;=3D=3D> x%y
=C2=A0| =C2=A0
=C2=A0| =C2=A0__mul__(...)
=C2=A0= | =C2=A0 =C2=A0 =C2=A0x.__mul__(y) <=3D=3D> x*y
...

The __m= ul__ method implements multiplication. I don't know the specific implem= entation in numpy, but it's probably little more than a thin wrapper ar= ound x * y (with perhaps some type and overflow checking).

Skip

--089e013cc450a73fa70504fff8f0--