Export to GitHub

gmpy - issue #8

mpz(1.721116539913617e-052) crashes


Posted on Jul 29, 2008 by Helpful Kangaroo

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from gmpy import mpz >>> mpz(1.721116539913617e-052)

crashes Python.

Comment #1

Posted on Jul 30, 2008 by Grumpy Wombat

This crash occurs on Windows but not on Linux. It appears to be a bug in GMP when compiled on Windows using mingw. I added a test in gmpy.c to force small vlaue of a float to zero before calling GMP.

Patch will be committed in a few minutes.

Comment #2

Posted on Aug 2, 2008 by Grumpy Wombat

This turns out to be a bug in GMP 4.2.1 that is fixed in GMP 4.2.2. It is not OS specific other than that I built the Windows binaries using GMP 4.2.1 because that version of GMP is still licensed under LGPL 2+.

Status: Fixed

Labels:
Type-Defect Priority-Medium