diff --git a/question.php b/question.php index 1a92839..e838269 100644 --- a/question.php +++ b/question.php @@ -587,7 +587,7 @@ public static function randomize_vars(array &$vars, array $inequalities, $timeli * @return int|float Random number in the set {x| $min <= x <= $max, x = $min + n * $increment, n ∈ N} */ public static function random_incremented_value($min, $max, $increment) { - return $min + mt_rand(0, ($max - $min) / $increment) * $increment; + return $min + mt_rand(0, intval(($max - $min) / $increment)) * $increment; } /**