Java Random Double randomDouble(int start, int end)

Here you can find the source of randomDouble(int start, int end)

Description

random Double

License

Open Source License

Declaration

public static double randomDouble(int start, int end) 

Method Source Code

//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;
    }
}

Related

  1. randomDouble(double low, double high)
  2. randomDouble(double min, double max)
  3. randomDouble(double min, double max)
  4. randomDouble(double min, double max)
  5. randomDouble(int min, int max)
  6. randomDoubleArray(final int mDimensionality)
  7. randomDoubleArray(int len)
  8. randomDoubleBetween(double a, double b)
  9. randomDoubleOperand(Random rnd)