Quote 引用元:GomezAddams 投稿を閲覧
When you generate a random number in code, it looks something like random(100), meaning a random number between 0 - 99, NOT 1 - 100. Computers start at zero by default in almost every language. The problem we ran into is a rookie mistake that a first year student wouldn't even make after week 3. To compensate, you return the number generated PLUS 1. Somebody forgot the plus 1. It's really that simple.
Not really. You could get also overflows if you add 1 to the generated number. And there are programming languages like C++ where overflows have disastrous effects.


Cheers