mirror of https://github.com/Nonannet/copapy.git
pow function fixed in _math.py
This commit is contained in:
parent
662a168d90
commit
aacdc9b676
|
|
@ -79,10 +79,10 @@ def pow(x: VecNumLike, y: VecNumLike) -> Any:
|
||||||
for _ in range(y - 1):
|
for _ in range(y - 1):
|
||||||
m *= x
|
m *= x
|
||||||
return m
|
return m
|
||||||
if y == -1:
|
|
||||||
return 1 / x
|
|
||||||
if isinstance(x, value) or isinstance(y, value):
|
if isinstance(x, value) or isinstance(y, value):
|
||||||
return add_op('pow', [x, y])
|
return add_op('pow', [x, y])
|
||||||
|
elif y == -1:
|
||||||
|
return 1 / x
|
||||||
else:
|
else:
|
||||||
return float(x ** y)
|
return float(x ** y)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue