Quote:
|
In old-fashioned QuickBASIC (MS-DOS days), the keyword RND returned a float (a SINGLE, as in single-precision floating-point type) between 0 and 1. To change the values, you actually had to multiply rather than use the modulus operator:
|
LOL! We use the same thing in Java to generates double random value!
Here's how Java generates double random value:
Code:
Random r = new Random();
r.nextDouble(); // Generates double between 0.0 and 1.0
r.nextDouble() * 10; // then generates random number between 0.0 and 10.0