From a1135de5d9911838f4c020d73be9c462cba709d1 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Thu, 26 May 2011 15:46:15 +0200 Subject: fix blazar nil error --- lib/model.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/model.rb b/lib/model.rb index 14471cc..edaa696 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -207,7 +207,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 -- cgit v1.2.3