Here you can find the source of getRandomNum(double pSngBegin, double pSngEnd)
public static double getRandomNum(double pSngBegin, double pSngEnd)
//package com.java2s; import java.util.Random; public class Main { private static final Random random = new Random(); public static double getRandomNum(double pSngBegin, double pSngEnd) { if (pSngEnd < pSngBegin) { throw new IllegalArgumentException("pSngEnd must not smaller than pSngBegin"); }// ww w .j av a 2 s . c o m return (pSngEnd - pSngBegin) * Math.random() + pSngBegin; } public static double getRandomNum(final long seed, double pSngBegin, double pSngEnd) { if (pSngEnd < pSngBegin) { throw new IllegalArgumentException("pSngEnd must not smaller than pSngBegin"); } return (pSngEnd - pSngBegin) * Math.random() + pSngBegin; } }