Thanks to visit codestin.com
Credit goes to github.com

Skip to content

numpy.fromstring unable to parse values > 2^32 on 32 bit arch #4575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jpwhite4 opened this issue Apr 1, 2014 · 1 comment · Fixed by #4712
Closed

numpy.fromstring unable to parse values > 2^32 on 32 bit arch #4575

jpwhite4 opened this issue Apr 1, 2014 · 1 comment · Fixed by #4712

Comments

@jpwhite4
Copy link

jpwhite4 commented Apr 1, 2014

Steps to reproduce:
run the following command on a 32 bit x86 python:

numpy.fromstring( "25041670086757 104783749223640", dtype=numpy.uint64, sep=' ')

and the incorrect output is:

array([4294967295, 4294967295], dtype=uint64)

If the same command is executed on a 64 bit machine, the output appears correct:

array([ 25041670086757, 104783749223640], dtype=uint64)

Versions tested:
numpy 1.8.1
Python 2.7.3 (default, Feb 27 2014, 20:00:17) [GCC 4.6.3] on linux2

@abalkin
Copy link
Contributor

abalkin commented Apr 2, 2014

gh-4577 is a "proof of concept" patch. It fixes the issue for 32-bit python on MacOS, but I have not tested it anywhere else. The problem is that Python does not provide cross-platform PyOS_ versions of strtoll and strtoull, so I created my own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants