[pypy-svn] r14271 - pypy/dist/pypy/objspace/std

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Jul 5 13:10:31 CEST 2005


Author: cfbolz
Date: Tue Jul  5 13:10:30 2005
New Revision: 14271

Modified:
   pypy/dist/pypy/objspace/std/intobject.py
   pypy/dist/pypy/objspace/std/longobject.py
Log:
fixed div for ints and longs


Modified: pypy/dist/pypy/objspace/std/intobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/intobject.py	(original)
+++ pypy/dist/pypy/objspace/std/intobject.py	Tue Jul  5 13:10:30 2005
@@ -209,13 +209,8 @@
     m = x % y
     return space.wrap((z,m))
 
-old_style_div = 1 / 2 == 1 // 2
 def div__Int_Int(space, w_int1, w_int2):
-    # Select the proper div
-    if old_style_div:
-        return _floordiv(space, w_int1, w_int2)
-    else:
-        return _truediv(space, w_int1, w_int2)
+    return _floordiv(space, w_int1, w_int2)
 
 floordiv__Int_Int = _floordiv
 truediv__Int_Int = _truediv

Modified: pypy/dist/pypy/objspace/std/longobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/longobject.py	(original)
+++ pypy/dist/pypy/objspace/std/longobject.py	Tue Jul  5 13:10:30 2005
@@ -261,14 +261,8 @@
     div, rem = _divrem(space, w_long1, w_long2)
     return div
 
-old_style_div = 1 / 2 == 1 // 2
 def div__Long_Long(space, w_long1, w_long2):
-    # Select the proper div
-    if old_style_div:
-        return floordiv__Long_Long(space, w_long1, w_long2)
-    else:
-        return truediv__Long_Long(space, w_long1, w_long2)
-
+    return floordiv__Long_Long(space, w_long1, w_long2)
 
 def mod__Long_Long(space, w_long1, w_long2):
     div, rem = _divrem(space, w_long1, w_long2)



More information about the Pypy-commit mailing list