Bugs in version 5.45.0.0

GLADO

Новичок
Регистрация
17.07.2019
Сообщения
5
Благодарностей
0
Баллы
1
When generating a Random Number "From 1 to X" I always assumed it would include the X as a potential generated number. However, when generating a random number, it never includes X as a potentially generated number, so I must include X+1 for the range. For instance, if I want to select a number between 1 and 5 (1,2,3,4,5) I have to set the range from 1 to 6. Is this normal functioning of this? Thanks.
 

Вложения

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
18 123
Благодарностей
4 452
Баллы
113
When generating a Random Number "From 1 to X" I always assumed it would include the X as a potential generated number. However, when generating a random number, it never includes X as a potentially generated number, so I must include X+1 for the range. For instance, if I want to select a number between 1 and 5 (1,2,3,4,5) I have to set the range from 1 to 6. Is this normal functioning of this? Thanks.
Yes, this is normal behavior for random generation in programming.
 
  • Спасибо
Реакции: GLADO

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)