mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 20:05:33 -05:00
added assertion that n >= 0
This commit is contained in:
@@ -1097,6 +1097,7 @@ def integer_squareroot(n: int) -> int:
|
||||
"""
|
||||
The largest integer ``x`` such that ``x**2`` is less than ``n``.
|
||||
"""
|
||||
assert n >= 0
|
||||
x = n
|
||||
y = (x + 1) // 2
|
||||
while y < x:
|
||||
|
||||
Reference in New Issue
Block a user