Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78898

Re: Numpy, uint64 and Big O notation.

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.034
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'cc:addr:python-list': 0.11; 'python': 0.11; 'assume': 0.14; 'numpy': 0.16; 'subject:Big': 0.16; 'uint64': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'thu,': 0.19; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'fine': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'could': 0.34; 'received:google.com': 0.35; 'there': 0.35; 'space': 0.40; 'skip:n 10': 0.64; 'more': 0.64; 'skip:1 20': 0.65; 'to:addr:gmail.com': 0.65; 'covers': 0.68; 'complexity': 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=9BrRrK5CguGQa7DKpMUsqIpa1FzO5ZvokyuBUQTRqqo=; b=sIODyXCODJXiZkq1tBHVm3HJhchijT7lZ0e4aoWczDdXpw5FlWH/nv07tYVNKEt0mf +8QOfB7684IwYulVc3RDE80YVXyLbtcecCsV6MvSwGoFtd7PK6rxlFbGZYNrBE2cYMRc sKtNRlVWG7Je02U9f6MjkyzsHfWkoEKnKRAFovj9s2AIDkXrcRipifqDVWJ8WpCkqFN2 tXHe52RtG2IZin4ZOmXk8aiBMIIh4DKWi4mOsUVQW3Ey4N666IsOAeTBGaKhoObccoE+ KHtY58uEFPZHmaolYBopPOc1mLCtTWu4lER3LVDh1oTlzVdFGdClIzY7cH8gbQRqfimW BMlQ==
MIME-Version 1.0
X-Received by 10.50.8.1 with SMTP id n1mr28318537iga.24.1412869196934; Thu, 09 Oct 2014 08:39:56 -0700 (PDT)
In-Reply-To <4fca2ff7-ad35-4514-b142-d4330c137fdb@googlegroups.com>
References <4fca2ff7-ad35-4514-b142-d4330c137fdb@googlegroups.com>
Date Thu, 9 Oct 2014 10:39:56 -0500
Subject Re: Numpy, uint64 and Big O notation.
From Skip Montanaro <skip.montanaro@gmail.com>
To marksabbath@gmail.com
Content-Type text/plain; charset=UTF-8
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14718.1412869199.18130.python-list@python.org> (permalink)
Lines 39
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1412869199 news.xs4all.nl 2952 [2001:888:2000:d::a6]:48122
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78898

Show key headers only | View raw


On Thu, Oct 9, 2014 at 8:08 AM,  <marksabbath@gmail.com> wrote:

> I'm trying to find out the best way to multiply an uint64 (numpy). Could someone help me find the best way to achieve that and where can I find the time and space complexity in a Big O notation?

Multiply it by what? This works fine for me:

>>> import numpy
>>> x = numpy.uint64(57)
>>> x
57
>>> type(x)
<type 'numpy.uint64'>
>>> xx = x * x
>>> type(xx)
<type 'numpy.uint64'>
>>> xx
3249
>>> xxx = xx * xx
>>> xxx
10556001
>>> xxxx = xxx * xxx
>>> xxxx
111429157112001
>>> type(xxxx)
<type 'numpy.uint64'>
>>> xxxxx = xxxx * xxxx
>>> type(xxxxx)
<type 'numpy.uint64'>
>>> xxxxx
12238449225650938241

I assume under the covers there must be a Python long somewhere:

>>> int(xxxxx)
12238449225650938241L

I think your question needs to be more concrete.

Skip

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Numpy, uint64 and Big O notation. marksabbath@gmail.com - 2014-10-09 06:08 -0700
  Re: Numpy, uint64 and Big O notation. Skip Montanaro <skip.montanaro@gmail.com> - 2014-10-09 10:39 -0500
  Re: Numpy, uint64 and Big O notation. Skip Montanaro <skip.montanaro@gmail.com> - 2014-10-09 11:31 -0500

csiph-web