Java Random Int randomNumberWithinRange(int low, int high)

Here you can find the source of randomNumberWithinRange(int low, int high)

Description

random Number Within Range

License

LGPL

Declaration

public static int randomNumberWithinRange(int low, int high) 

Method Source Code

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

public class Main {
    public static int randomNumberWithinRange(int low, int high) {
        int result = (int) (Math.random() * (high - low + 1)) + low;
        return result;
    }//from w  w  w  . ja  v a2  s .c o m
}

Related

  1. randomNumber(int lower, int upper)
  2. randomNumber(int lower_bound, int higher_bound)
  3. randomNumber(int min, int max)
  4. randomNumber(int minimum, int maximum)
  5. randomNumberBetweenIntervals(int min, int max)
  6. randomNumberWithinRange(int min, int max)
  7. randomPass(int n)
  8. randomPointInConvexPoly(float[] pts, int npts, float[] areas, float s, float t)
  9. randomPointsFromFigureEight(int n)