From d2eca7348270d5de21fe72fd38da4522099e5a63 Mon Sep 17 00:00:00 2001 From: jonny rhea Date: Thu, 10 Jan 2019 18:09:58 -0600 Subject: [PATCH] added assertion that n >= 0 --- specs/core/0_beacon-chain.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 5127a541f..671130ebe 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -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: