The documentation shows the random_int(min, max) returns a number from min (inclusive) to max (exclusive). However, the implementation provides a number from min (inclusive) to max (inclusive). Most random number generators return numbers inclusive to exclusive. There is also a concern that if the number passed for max is already the maximum uint16_t, when the function adds 1 it will overflow.
This is a suggestion for maybe somebody to do in a pull request.
The documentation shows the
random_int(min, max)returns a number from min (inclusive) to max (exclusive). However, the implementation provides a number from min (inclusive) to max (inclusive). Most random number generators return numbers inclusive to exclusive. There is also a concern that if the number passed for max is already the maximum uint16_t, when the function adds 1 it will overflow.This is a suggestion for maybe somebody to do in a pull request.