Lichen

Changeset

896:3a73899174a4
2019-02-04 Paul Boddie raw files shortlog changelog graph Optimised pow to avoid an unnecessary type check after conversion to float. trailing-data
lib/operator/binary.py (file)
     1.1 --- a/lib/operator/binary.py	Mon Feb 04 18:30:52 2019 +0100
     1.2 +++ b/lib/operator/binary.py	Mon Feb 04 18:53:56 2019 +0100
     1.3 @@ -92,7 +92,7 @@
     1.4          return int_pow(a, b)
     1.5      elif a.__class__ is float:
     1.6          if is_int(b):
     1.7 -            b = int_float(b)
     1.8 +            return float_pow(a, int_float(b))
     1.9          if b.__class__ is float:
    1.10              return float_pow(a, b)
    1.11      return binary_op(a, b, lambda a: a.__pow__, lambda b: b.__rpow__)