Gear61 / Random-Number-Generator

A clean, simple random number generator for Android. Downloaded 180,000+ times and rated 2,000+ times on Google Play with 4.7+ average rating.
39 stars 24 forks source link

Sum can overflow #41

Closed elydpg closed 3 years ago

elydpg commented 5 years ago

It is possible that the sum can overflow, as in this image.

example where the sum can overflow

This can be fixed by storing the sum in a long, rather than an int.

Gear61 commented 5 years ago

Ah, good catch! Forgot about the good ol' int overflow.