[pypy-svn] r8329 - pypy/trunk/src/pypy/appspace

ale at codespeak.net ale at codespeak.net
Mon Jan 17 15:43:22 CET 2005


Author: ale
Date: Mon Jan 17 15:43:22 2005
New Revision: 8329

Modified:
   pypy/trunk/src/pypy/appspace/struct.py
Log:
The struct module passes all Python regression test ( on my machine anyway Win2k, Python 2.4)

TODO : implement the sanefloat function (do some test on the floats)

do something about INF and NAN and friends

Modified: pypy/trunk/src/pypy/appspace/struct.py
==============================================================================
--- pypy/trunk/src/pypy/appspace/struct.py	(original)
+++ pypy/trunk/src/pypy/appspace/struct.py	Mon Jan 17 15:43:22 2005
@@ -151,6 +151,9 @@
         e += bias
         mantissa = int(2**prec *(man) +0.5)   
         res=[]
+        if mantissa >> prec :
+            mantissa = 0
+            e += 1
         
         for i in range(size-2):
             res += [ mantissa & 0xff]



More information about the Pypy-commit mailing list