title: Is there an IDIOMATIC way to get a random Fixnum in Ruby?
body: <p>I'm playing with an algorithm which uses random numbers. It would be nice to be able to maximize the randomness I can get while keeping the number a nice reasonably-performant integer, so ideally they'd be in the range <code>Fixnum::MIN .. Fixnum::MAX</code>, but <code>0..Fixnum::MAX</code> ought to be fine too.</p>
  
  <p><strong>OH WAIT</strong>. Those constants <strong>aren't actually things that exist</strong>. So when you read that <a href="http://www.ruby-doc.org/core/Random.html" rel="nofollow noreferrer"><code>Random.rand</code> returns a float unless you pass it an integer argument</a> the only obvious course of action is to <a href="https://stackoverflow.com/questions/535721/ruby-max-integer">resort to terrible hacks like these</a>.</p>
  
  <p>Is there any more-idiomatic way to get a random integer in Ruby, or does Yukihiro just expect me to make my code hideous and duplicate dubious integer-size exponentiation if I want this sort of capability?</p>