Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Get your Bumpers ready!



On 17-Nov-97 Craig Oda wrote:
> How does one get really random numbers in a certain range under
>Linux, preferrably with Java?

The Math package has a pseudo-random random() method which you call
like this:

    double d = Math.random(); // 0.0 .. 1.0

The book I'm looking at (Just Java) seems to imply that the range to
include both 0.0 and 1.0, which is a little odd. I would expect the
range to be 0.0 <= d < 1.0 or 0.0 < d <= 1.0.  If the boundary
conditions matter, I'd look it up to be sure.

- Ken
---------------------------------------------------------------
TLUG Meeting Dec. 13, 12:30 at Tokyo station Yaesu Chuo ticket gate
13:30 Starbuck's coffee.  13:45 HSBC | info: joem@example.com
At least 3 functional Sparc IPC machines will be raffled out
---------------------------------------------------------------
a word from the sponsor:
TWICS - Japan's First Public-Access Internet System
www.twics.com  info@example.com  Tel:03-3351-5977  Fax:03-3353-6096



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links