Java Random Int Random(int a, boolean Zero)

Here you can find the source of Random(int a, boolean Zero)

Description

Random

License

Open Source License

Declaration

public static double Random(int a, boolean Zero) 

Method Source Code

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

public class Main {
    public static double Random(int a, boolean Zero) {
        if (Zero) {
            return Math.random() * a;
        } else {/*from  w w w .j a  va2 s  . co  m*/
            return Math.random() * (a - 1) + 1;
        }
    }
}

Related

  1. RandInt(int x, int y)
  2. randIntArray(int length)
  3. randIntArray(int length)
  4. randIntv(double fr, double to)
  5. randLocation(int min, int max)
  6. random(int length)
  7. random(int length)
  8. random(int length, String data)
  9. random(int limit)