We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generating random numbers within a defined range is not working. Numbers are generated outside of the range sometimes.
let math = require("math");
function getRandomArbitrary(min, max) { return math.floor(math.random() * (max - min + 1)) + min; }
while (1 === 1) { let randomIndex = getRandomArbitrary(0, 23); print(randomIndex); delay(1000); }
No response
The text was updated successfully, but these errors were encountered:
By running this script:
let math = require("math") while (true) { print(math.random()) delay(500) }
We can see that sometimes, it returns values higher than 1
Devbuild version: momentum dev c633b0f 1st April of 2024
Sorry, something went wrong.
can you check on #67 ?
Fix was released in mntm-002
Willy-JL
Successfully merging a pull request may close this issue.
Describe the bug.
Generating random numbers within a defined range is not working. Numbers are generated outside of the range sometimes.
Reproduction
let math = require("math");
function getRandomArbitrary(min, max) {
return math.floor(math.random() * (max - min + 1)) + min;
}
while (1 === 1) {
let randomIndex = getRandomArbitrary(0, 23);
print(randomIndex);
delay(1000);
}
Target
No response
Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: