1
0
This commit is contained in:
Jeff 2023-08-24 05:32:47 -04:00
parent 19a053a288
commit 7c6a4e5ece

View File

@ -56,8 +56,8 @@ impl Tool for RandomInteger {
Error::expect_function_argument_amount(self.info().identifier, min_max.len(), 2)?;
let min = min_max[0].as_int()?;
let max = min_max[1].as_int()?;
let integer = rand::thread_rng().gen_range(min..=max);
let max = min_max[1].as_int()? + 1;
let integer = rand::thread_rng().gen_range(min..max);
Ok(Value::Integer(integer))
}