Java Random decimal_random()

Here you can find the source of decimal_random()

Description

decimarandom

License

Open Source License

Declaration

public static String decimal_random() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static String decimal_random() {
        String valor_retorno = new String("");
        int[] ndigitos = new int[10];
        int n;/* w  ww  . j a v  a  2s .  co m*/
        Random rnd = new Random();
        for (int i = 0; i < 10; i++)
            ndigitos[i] = 0;
        for (long i = 0; i < 100000L; i++) {
            n = (int) (rnd.nextDouble() * 10.0);
            ndigitos[n]++;
        }
        rnd.setSeed(new Date().getTime());
        valor_retorno = Double.toString(rnd.nextDouble());
        return valor_retorno;
    }
}

Related

  1. createRandomStr(int digit)
  2. equalsRandomIterable(List a, List bl)
  3. extractRandomObject(Collection c)
  4. extractRandomVector(Collection c, int newSize)
  5. gaussianInt(Random random, int min, int max)