Here you can find the source of randomDouble(int start, int end)
public static double randomDouble(int start, int end)
//package com.java2s; /*//from w w w . j a va 2 s . com * ComparatorHelper.java 2008-9-19 * * ??????: ???????(FTO)???? 2000-2005, ?????????. * ????????????(FTO)???????????????????????????????????????? * * Copyright 2000-2005 FTO Software Team, Inc. All Rights Reserved. * This software is the proprietary information of FTO Software Team, Inc. * Use is subject to license terms. * */ import java.util.Random; public class Main { private static Random rnGenerator; public static double randomDouble(int start, int end) { if (start > end) { int t = start; start = end; end = t; } long scope = ((long) end - (long) start); return rnGenerator.nextDouble() * scope + start; } }