summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/model.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 28c05a9..cb24f23 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -208,7 +208,7 @@ module OpenTox
# AM: Balanced predictions
addon = (modulo[1].to_f/modulo[0]).ceil # what will be added in each round
- slack = modulo[1].divmod(addon)[1] # what remains for the last round
+ slack = (addon!=0 ? modulo[1].divmod(addon)[1] : 0) # what remains for the last round
position = 0
predictions = Array.new