mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 11:14:38 +08:00
Special handling for base -1, 0, 1 for big exp
This commit is contained in:
1 parent
c18615b6e5
commit
0bf7ff96b8
2 files changed
+21
-6
No files matched your search
@@ -39,9 +39,14 @@ assert_raises(
|
||||
lambda: round(-float('inf')),
|
||||
'OverflowError: cannot convert float NaN to integer')
|
||||
|
||||
assert pow(0, 0) == 1
|
||||
assert pow(2, 2) == 4
|
||||
assert pow(1, 2.0) == 1.0
|
||||
assert pow(2.0, 1) == 2.0
|
||||
assert pow(0, 10**1000) == 0
|
||||
assert pow(1, 10**1000) == 1
|
||||
assert pow(-1, 10**1000+1) == -1
|
||||
assert pow(-1, 10**1000) == 1
|
||||
|
||||
assert pow(2, 4, 5) == 1
|
||||
assert_raises(
|
||||
|
||||
Reference in new issue
Block a user