Index:
[thread]
[date]
[subject]
[author]
From: Michael Abernethy <mna@duke.edu>
To :
Date: Sun, 28 Mar 1999 17:24:53 -0500
Re: Java help?
If you scour the Java API carefully, you'll find that there is a
java.math library and a java.lang.Math library.
The two are not the same and shouldn't be confused.
The random function that you are looking for is in the java.lang.Math
library, and I think it explains in there that it calls the java.math
library. (can't remember exactly).
Anyway, look there for the random() function and its details.
>
> Angel, I didn't find anything in java.math, either. However,
> I did find a class called Random in the java.util library. It has
> a few procedures for creating random numbers of various
> types:
>
> nextDouble() returns a double (0.0 <= x < 1.0)
> nextFloat() returns a float (0.0 <= x < 1.0)
> nextLong() returns a long between the highest and lowest longs
> nextInt() returns a int between the highest and lowest ints
>
> You can set the seed value with a call to:
> setSeed(long)
>
>
Mike Abernethy
www.duke.edu/~mna
IBM Club Cyberblue - www.cybrblu.ibm.com
Index:
[thread]
[date]
[subject]
[author]