This is driving me crazy.
I'm expecting this to generate a random number between 0 and 2 in Java.
int x = (int)(Math.random()*2);
However it's only generating 0s and 1s. What am I doing wrong here?
Thanks,
Strick
|
Results 1 to 4 of 4
Thread: Random number between 0 and 2Threaded View
|
Click Here to Expand Forum to Full Width |