-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
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
JS: Random function in Math library not working right. #61
Labels
bugfix
Something isn't working
Comments
corrupt3k
changed the title
JS: Math library not working right.
JS: Random function in Math library not working right.
Mar 30, 2024
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 |
can you check on #67 ? |
2 tasks
Willy-JL
added
bugfix
Something isn't working
release-pending
This is done, will be in next release
labels
Apr 2, 2024
Fix was released in mntm-002 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: