upiterbarg / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

1000000000 decimal places crash. #207

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Give to a number a precision of 1000000000 decimal places.

What is the expected output? What do you see instead?
The window of python close.

What version of the product are you using? On what operating system?
python 3.2, Windows 7 SP1.

Please provide any additional information below.
This only works with the gmpy enable and problably the don't crash with him 
disabled but it's not tested because it's too slow.

Original issue reported on code.google.com by matos.fr...@gmail.com on 19 Apr 2011 at 8:52

GoogleCodeExporter commented 9 years ago
1 billion decimal places is more than 3 billion bits, so the precision doesn't 
fit in a machine integer on 32-bit systems (2^31-1 = 2,147,483,647). If you 
have a 64-bit system, this should work fine. My suggestion is that you get a 
64-bit system :)

Original comment by fredrik....@gmail.com on 20 Apr 2011 at 4:41

GoogleCodeExporter commented 9 years ago
I wonder why it crashes, it should raise a MemoryError instead, shouldn't it? 
(At least this is what happens on my system.)

Original comment by Vinzent.Steinberg@gmail.com on 11 May 2011 at 10:24

GoogleCodeExporter commented 9 years ago
The mpmath helper functions in gmpy use the C long type internally. A C long is 
32 bits on both 32 and 64-bit versions of Windows. I have implemented a fix 
that uses a 64-bit integer type on 64-bit Windows in the development version of 
gmpy2. The issue doesn't impact Linux systems since a C long is 64 bits on 
64-bit versions of Linux. I'll update this issue when I release the next 
version of gmpy2. If anyone would like a test build, just let me know.

Original comment by casevh on 23 Jan 2012 at 7:31