Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pow(2, -1, 5) == 3 on Python >= 3.8
  • Loading branch information
cclauss authored Nov 24, 2019
commit 59098988240abf4f743f907501bccc147ab88e95
6 changes: 5 additions & 1 deletion tests/snippets/math_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
assert_raises(TypeError, pow, 2, 4, 5.0)
assert_raises(TypeError, pow, 2, 4.0, 5)
assert_raises(TypeError, pow, 2.0, 4, 5)
assert_raises(ValueError, pow, 2, -1, 5)
from sys import version_info
if version_info < (3, 8):
assert_raises(ValueError, pow, 2, -1, 5)
else: # https://docs.python.org/3/whatsnew/3.8.html#other-language-changes
assert pow(2, -1, 5) == 3
assert_raises(ValueError, pow, 2, 2, 0)

# bitwise
Expand Down