Skip to content

Commit

Permalink
Add overflow case
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Feb 14, 2024
1 parent 7076fb2 commit 42bc600
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ def test_integer_squareroot(spec):
n = rng.randint(0, 2**64 - 1)
uint64_n = spec.uint64(n)
assert spec.integer_squareroot(uint64_n) == isqrt(n)

try:
spec.integer_squareroot(spec.uint64(2**64))
assert False
except ValueError:
pass

0 comments on commit 42bc600

Please sign in to comment.