mardi 17 janvier 2017

Properties of MersenneTwister() in Java

I am importing the following two libraries, though I cannot get them to work in my *.java file. The documentation online isn't helpful either.

This is from third-party software:

import cern.jet.random.engine.RandomEngine;
import cern.jet.random.engine.MersenneTwister;

static RandomEngine var = new MersenneTwister( (int)System.currentTimeMillis() );

I have tried running printing out the above variable var but I cannot get the following to compile correctly:

import java.util.*;
import cern.jet.random.engine.MersenneTwister;
import cern.jet.random.engine.RandomEngine;

public class printy{
    static RandomEngine var = new MersenneTwister( (int)System.currentTimeMillis()
 );
    System.out.println(var);
}

My question is, what is the size of this random number? Does it output a random number between 1 and the size of a 32-bit integer? What is the range size of var?




Aucun commentaire:

Enregistrer un commentaire