title: Random number in long range, is this the way?
body: <p>Can somebody verify this method. I need a long type number inside a range of two longs. I use the .NET Random.Next(min, max) function which return int's. Is my reasoning correct if I simply divide the long by 2, generate the random number and finally multiply it by 2 again? Or am I too enthusiastic...
  I understand that my random resolution will decrease but are there any other mistakes which will lead to no such a random number.</p>
  
  <pre><code>long min = st.MinimumTime.Ticks;    //long is Signed 64-bit integer
  long max = st.MaximumTime.Ticks;
  int minInt = (int) (min / 2);      //int is Signed 64-bit integer
  int maxInt = (int) (max / 2);      //int is Signed 64-bit integer
  
  Random random = new Random();
  int randomInt = random.Next(minInt, maxInt);
  long randomLong = (randomInt * 2);
  </code></pre>