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


Groups > comp.lang.python > #78898

Re: Numpy, uint64 and Big O notation.

References <4fca2ff7-ad35-4514-b142-d4330c137fdb@googlegroups.com>
Date 2014-10-09 10:39 -0500
Subject Re: Numpy, uint64 and Big O notation.
From Skip Montanaro <skip.montanaro@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.14718.1412869199.18130.python-list@python.org> (permalink)

Show all headers | 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