random deviation above 1
in
Programming Questions
•
11 months ago
If i look at the javadocs:
http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextGaussian()
then nextGaussian() should give me a mean value of zero and a deviation of 1.
However when i test with this:
http://docs.oracle.com/javase/6/docs/api/java/util/Random.html#nextGaussian()
then nextGaussian() should give me a mean value of zero and a deviation of 1.
However when i test with this:
- Random generator;
- float min = MAX_FLOAT;
- float max = MIN_FLOAT;
- void setup() {
- size(640, 360);
- generator = new Random();
- }
- void draw() {
- background(0);
- float num = (float)generator.nextGaussian();
- min = min(min, num);
- max = max(max, num);
- text("min: "+min+"\nmax: "+max, 50, 50);
- }
My deviation is around 4.
what's up with that?
what's up with that?
1