Commits

Armin Rigo  committed c5d0416

Special-case in RPython the case of "x ** 2.0".

  • Participants
  • Parent commits 5c3a4d5

Comments (0)

Files changed (1)

File pypy/rpython/lltypesystem/module/ll_math.py

     # deal directly with IEEE specials, to cope with problems on various
     # platforms whose semantics don't exactly match C99
 
+    if y == 2.0:
+        return x * x     # this is always a correct answer, and is relatively
+                         # common in user programs.
+
     if isnan(y):
         if x == 1.0:
             return 1.0   # 1**Nan = 1