[pypy-svn] r15937 - pypy/dist/pypy/module/math

pedronis at codespeak.net pedronis at codespeak.net
Wed Aug 10 19:59:21 CEST 2005


Author: pedronis
Date: Wed Aug 10 19:59:20 2005
New Revision: 15937

Modified:
   pypy/dist/pypy/module/math/interp_math.py
Log:
use math.pow, ** and math.pow have slightly different errors behavior (ZeroDivisionError vs only ValueError and 
OverflowError)

so no matter whether rpython float**float will be mostly unchecked or with the same behavior as CPython **

we likely want math.pow here



Modified: pypy/dist/pypy/module/math/interp_math.py
==============================================================================
--- pypy/dist/pypy/module/math/interp_math.py	(original)
+++ pypy/dist/pypy/module/math/interp_math.py	Wed Aug 10 19:59:20 2005
@@ -46,13 +46,12 @@
     return space.wrap(r)
 math2._annspecialcase_ = 'specialize:arg1'    
 
-def pow(space, x, y): # xxx sort out the exception semantics of this, here in the backend and in floatobject
-                      # do we want math.pow here?
+def pow(space, x, y):                     
     """pow(x,y)
        
        Return x**y (x to the power of y).
     """
-    return space.wrap(x ** y)
+    return math2(space, math.pow, x, y)
 pow.unwrap_spec = [ObjSpace, float, float]
 
 def cosh(space, x): 



More information about the Pypy-commit mailing list