Alright, thanks again!
On Mon, Apr 4, 2016 at 3:58 PM, Maciej Fijalkowski wrote:
> you can write a if in_pypy wrapper that uses __pypy__.intops or
> something, but for exactly the same code is hard to do better. We can
> think about adding some optimizations that do that btw
>
>
> On Mon, Apr 4,
you can write a if in_pypy wrapper that uses __pypy__.intops or
something, but for exactly the same code is hard to do better. We can
think about adding some optimizations that do that btw
On Mon, Apr 4, 2016 at 3:53 PM, Tuom Larsen wrote:
> So other than numpy, do you think:
>
> a[0] = (2**
So other than numpy, do you think:
a[0] = (2**63 << 1) & (2**64 - 1)
is the best way I can do?
On Mon, Apr 4, 2016 at 3:52 PM, Tuom Larsen wrote:
> Yes, I just want to write code which is portable (as for example that
> `& ...`) but still favors PyPy.
>
> On Mon, Apr 4, 2016 at 3:49 PM, Mac
Yes, I just want to write code which is portable (as for example that
`& ...`) but still favors PyPy.
On Mon, Apr 4, 2016 at 3:49 PM, Maciej Fijalkowski wrote:
> right, so there is no way to get wrap-around arithmetics in cpython
> without modifications
>
> On Mon, Apr 4, 2016 at 3:48 PM, Tuom La
right, so there is no way to get wrap-around arithmetics in cpython
without modifications
On Mon, Apr 4, 2016 at 3:48 PM, Tuom Larsen wrote:
> I would like to avoid numpy, if possible. Even if it might be bundled
> with PyPy (is it?) I still would like the code to run in CPython with
> no depende
but if you dont actually overflow, the cost is really low btw
On Mon, Apr 4, 2016 at 3:49 PM, Maciej Fijalkowski wrote:
> right, so there is no way to get wrap-around arithmetics in cpython
> without modifications
>
> On Mon, Apr 4, 2016 at 3:48 PM, Tuom Larsen wrote:
>> I would like to avoid nu
I would like to avoid numpy, if possible. Even if it might be bundled
with PyPy (is it?) I still would like the code to run in CPython with
no dependencies.
On Mon, Apr 4, 2016 at 3:45 PM, Maciej Fijalkowski wrote:
> so numpy64 will give you wrap-around arithmetics. What else are you
> looking fo
so numpy64 will give you wrap-around arithmetics. What else are you
looking for? :-)
On Mon, Apr 4, 2016 at 3:38 PM, Tuom Larsen wrote:
> You mean I should first store the result into numpy's `int64`, and
> then to `array.array`? Like:
>
> x = int64(2**63 << 1)
> a[0] = x
>
> Or:
>
>
You mean I should first store the result into numpy's `int64`, and
then to `array.array`? Like:
x = int64(2**63 << 1)
a[0] = x
Or:
x = int64(2**63)
x[0] = x << 1
What the "real types" goes, is this the only option?
Thanks in any case!
On Mon, Apr 4, 2016 at 3:32 PM, Maciej Fi
one option would be to use integers from _numpypy module:
from numpy import int64 after installing numpy.
There are obscure ways to get it without installing numpy. Another
avenue would be to use __pypy__.intop.int_mul etc.
Feel free to complain "no, I want real types that I can work with" :-)
Hello!
Suppose I'm on 64-bit machine and there is an `a = arrar.array('L',
[0])` (item size is 8 bytes). In Python, when an integer does not fit
machine width it gets promoted to "long" integer of arbitrary size. So
this will fail:
a[0] = 2**63 << 1
To fix this, one could instead write:
11 matches
Mail list logo