Phr0zen_Penguin

Random Integer - Near Perfect

Feb 14th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. /*==================================================================================================
  2.   --------------------------------------------------------------------------------------------------
  3.   [RandInt.java]
  4.   Random integer generator.
  5.  
  6.         (c) Damion 'Phr0z3n.dev' Tapper, 2015.
  7.         Email: [email protected]
  8.         Website: L337Stuff.Blogspot.com
  9.   --------------------------------------------------------------------------------------------------
  10.   ==================================================================================================*/
  11. public class RandInt
  12. {
  13.     int getRandInt(int low, int high)
  14.     {
  15.         return(((int)((high - low + 1) * (Math.random()))) + low);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment