From c07a9e3ed948c6c240d90fa4371843f7d6bedfd9 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Wed, 5 Oct 2022 12:31:35 -0700 Subject: [PATCH] One more lil bug squash. Subsidiary functions... Fuzz FTW. --- bigjoyints/divmod.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bigjoyints/divmod.py b/bigjoyints/divmod.py index 69e2880..25aa937 100755 --- a/bigjoyints/divmod.py +++ b/bigjoyints/divmod.py @@ -196,6 +196,7 @@ def mul_digit_by_list_of_digits(digit, A): def int_to_list(i): assert i >= 0 + if not i: return [] return list(map(int, str(i)[::-1])) def list_to_int(A): @@ -221,8 +222,8 @@ def try_it(a, b): assert r == list_to_int(R) print(f'{list_to_int(Q)}, {list_to_int(R)}') -for _ in range(20): +for _ in range(10**6): try_it( - randint(0, 10**30), - randint(0, 10**4) + randint(0, 10**randint(3, 15)), + randint(1, 10**randint(1, 15)) )