Skip to content

Commit 659554f

Browse files
committed
prevent division by zero as per copilot
1 parent a65f940 commit 659554f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lectures/mccall_q.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ def run_epochs(N, qlmc, qtable, key):
602602
Run epochs N times with qtable from the last iteration each time.
603603
"""
604604
for n in range(N):
605-
if n % (N // 10) == 0:
605+
if n % max(1, N // 10) == 0:
606606
print(f"Progress: EPOCHs = {n}")
607607
608608
# Split key for this epoch

0 commit comments

Comments
 (0)