Here you can find the source of randIntv(double fr, double to)
public static double randIntv(double fr, double to)
//package com.java2s; /**//from w w w . j a v a2 s.com * Copyright (c) Lambda Innovation, 2013-2015 * ?????????Lambda Innovation??? * http://www.li-dev.cn/ * * This project is open-source, and it is distributed under * the terms of GNU General Public License. You can modify * and distribute freely as long as you follow the license. * ?????????????????GNU????????????? * ???????????????????????????? * http://www.gnu.org/licenses/gpl.html */ import java.util.Random; public class Main { private static Random RNG = new Random(); public static int randIntv(int fr, int to) { return RNG.nextInt(to - fr) + fr; } public static double randIntv(double fr, double to) { return (to - fr) * RNG.nextDouble() + fr; } }