[pypy-svn] r75866 - in pypy/branch/fast-forward: lib_pypy/app_test pypy/rlib/rstruct

benjamin at codespeak.net benjamin at codespeak.net
Tue Jul 6 00:43:06 CEST 2010


Author: benjamin
Date: Tue Jul  6 00:43:04 2010
New Revision: 75866

Removed:
   pypy/branch/fast-forward/lib_pypy/app_test/
Modified:
   pypy/branch/fast-forward/pypy/rlib/rstruct/ieee.py
Log:
kill app_test

Modified: pypy/branch/fast-forward/pypy/rlib/rstruct/ieee.py
==============================================================================
--- pypy/branch/fast-forward/pypy/rlib/rstruct/ieee.py	(original)
+++ pypy/branch/fast-forward/pypy/rlib/rstruct/ieee.py	Tue Jul  6 00:43:04 2010
@@ -5,6 +5,7 @@
 import math
 
 from pypy.rlib import rarithmetic
+from pypy.rlib.rarithmetic import r_ulonglong
 
 
 def round_to_nearest(x):
@@ -47,7 +48,7 @@
 
     # extract pieces
     sign = Q >> BITS - 1
-    exp = (Q & ((1 << BITS - 1) - (1 << MANT_DIG - 1))) >> MANT_DIG - 1
+    exp = int((Q & ((1 << BITS - 1) - (1 << MANT_DIG - 1))) >> MANT_DIG - 1)
     mant = Q & ((1 << MANT_DIG - 1) - 1)
 
     if exp == MAX_EXP - MIN_EXP + 2:
@@ -120,7 +121,7 @@
     assert 0 <= mant < 1 << MANT_DIG - 1
     assert 0 <= exp <= MAX_EXP - MIN_EXP + 2
     assert 0 <= sign <= 1
-    return ((sign << BITS - 1) | (exp << MANT_DIG - 1)) | mant
+    return r_ulonglong(((sign << BITS - 1) | (exp << MANT_DIG - 1)) | mant)
 
 
 def pack_float8(result, x):



More information about the Pypy-commit mailing list