Java Random Double randomBetween(double arg1, double arg2)

Here you can find the source of randomBetween(double arg1, double arg2)

Description

random Between

License

Apache License

Declaration

static final public int randomBetween(double arg1, double arg2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    static final public int randomBetween(double arg1, double arg2) {
        int i1 = (int) Math.ceil(arg1 < arg2 ? arg1 : arg2);
        int i2 = (int) Math.ceil(arg2 > arg1 ? arg2 : arg1);
        return i1 + (int) ((i2 - i1) * Math.random() + 0.5);
    }//from w  ww  .ja  v a  2s  .c o  m
}

Related

  1. RandInRange(double start, double end)
  2. random(double low, double high)
  3. random(double min, double max)
  4. random(double min, double max)
  5. random(final double min, final double max)
  6. randomBoth(double range)
  7. randomChance(double chance)
  8. randomColor(double d)
  9. randomDouble()