Daniel Dyer said:
To the OP, if you're in some special environment where you can generate
random integers but not doubles (J2ME perhaps?), you can just divide your
integers to turn them into decimal values.
<pseudoCode>
Generate a random integer between zero and a million.
Divide that integer by a million to get a decimal value between 0 and 1.
</pseudoCode>
However, if you have access to the nextDouble() method mentioned above,
you should probably use it, as it may produce "better" (more random?)
results.
- Oliver