Why is it giving me a negative number?

 
Greetings community,

I am using the strategy debugger and I don't understand why the variable 'puntosGridPrima' is resulting in a negative number.

'puntosGrid' is an integer whose value is 200,000 and 'MathRand()' is a random number between 0 and 32,767. In practically all the iterations it has done, it has given a positive number, but I was surprised that in this one it gave me a negative number.

Does anyone have any ideas?



 
Antonio Simon Del Vecchio:
Greetings community,

I am using the strategy debugger and I don't understand why the variable 'puntosGridPrima' is resulting in a negative number.

'puntosGrid' is an integer whose value is 200,000 and 'MathRand()' is a random number between 0 and 32,767. In practically all the iterations it has done, it has given a positive number, but I was surprised that in this one it gave me a negative number.

Does anyone have any ideas?

I already know the answer: Overflow 🤦