Java Random Double randomInRange(double min, double max)

Here you can find the source of randomInRange(double min, double max)

Description

random In Range

License

Open Source License

Declaration

public static double randomInRange(double min, double max) 

Method Source Code

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

public class Main {
    public static double randomInRange(double min, double max) {
        return Math.random() < 0.5 ? ((1 - Math.random()) * (max - min) + min)
                : (Math.random() * (max - min) + min);
    }//from   www .  ja  v a  2s. co  m
}

Related

  1. randomDoubleBetween(double a, double b)
  2. randomDoubleOperand(Random rnd)
  3. randomFlip(double probTrue)
  4. randomIn(double in)
  5. randomInitialize(double[] base)
  6. randomPercent(double percent)
  7. randomRange(double min, double max)
  8. randRealUniform(double minrange, double maxrange)