Skip to content

Commit 75db66d

Browse files
committed
follow copilot's suggestion to prevent division by 0
1 parent 088f91f commit 75db66d

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
@@ -694,7 +694,7 @@ def plot_epochs(epochs_to_plot, quit_allowed=1, key=None):
694694
max_epochs = int(jnp.max(epochs_to_plot)) # Convert to Python int
695695
# iterate on epoch numbers
696696
for n in range(max_epochs + 1):
697-
if n%(max_epochs/10)==0:
697+
if n % max(1, max_epochs // 10) == 0:
698698
print(f"Progress: EPOCHs = {n}")
699699
if n in epochs_to_plot:
700700
valfunc_qlr = valfunc_from_qtable(qtable)

0 commit comments

Comments
 (0)