Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const get_random_int = (min : number, max : number) : number => {
  2.     if (max < min) {
  3.         throw new Error("Upper bound of random interval has to be bigger than lower bound. Aborting.");
  4.     }
  5.     return Math.floor(Math.random() * (max - min)) + min;
  6. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement