Java Random Long random(long range)

Here you can find the source of random(long range)

Description

Returns a random value in the range [1 - range]

License

LGPL

Declaration

public static long random(long range) 

Method Source Code

//package com.java2s;

public class Main {
    /** Returns a random value in the range [1 - range] */
    public static long random(long range) {
        return (long) ((Math.random() * 100000) % range) + 1;
    }//from  w  w  w.j  av a 2s. c o  m
}

Related

  1. randLong(long minimum, long maximum)
  2. randLong(long n)
  3. random(long begin, long end)
  4. random(long max)
  5. random(long min, long max)
  6. randomHexOfLong(long max)
  7. randomLong()
  8. randomLong()
  9. randomLong(long min, long max)