Re:A common bug in published code
by __mark on Friday April 22, 2011 @06:35AM
(#2473697)
Oh, so it always rounds down to zero, that's pretty bad.
Casting it to a double would help right?
[ Parent
| on HN ]
Instead of
int runs = (int) Math.random() * 1000000;
You'd do
int runs = (int) (Math.random() * 1000000);