Можно ли указать верхнюю и нижнюю границы nextInt в Mersenne Twister RNG (Java) ⇐ JAVA
Можно ли указать верхнюю и нижнюю границы nextInt в Mersenne Twister RNG (Java)
I have a requirement to generate random numbers, specifically using the Mersenne Twister algorithm, in either Java/Kotlin (for Android). I've tried using the Apache commons-math Mersenne Twister implementation which works great to generate random integers. However I need to specify a fairly small range for these, the ints must be between 1 and 100.
It doesn't seem to be possible to specify upper and lower bounds with the Apache implementation. Does anyone know of any alternative Mersenne Twister options for Java/Kotlin that accept bounds for the nextInt generated?
Источник: https://stackoverflow.com/questions/569 ... rsenne-twi
I have a requirement to generate random numbers, specifically using the Mersenne Twister algorithm, in either Java/Kotlin (for Android). I've tried using the Apache commons-math Mersenne Twister implementation which works great to generate random integers. However I need to specify a fairly small range for these, the ints must be between 1 and 100.
It doesn't seem to be possible to specify upper and lower bounds with the Apache implementation. Does anyone know of any alternative Mersenne Twister options for Java/Kotlin that accept bounds for the nextInt generated?
Источник: https://stackoverflow.com/questions/569 ... rsenne-twi
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Можно ли указать верхнюю и нижнюю границы nextInt в Mersenne Twister RNG (Java)
Anonymous » » в форуме JAVA - 0 Ответы
- 23 Просмотры
-
Последнее сообщение Anonymous
-