title: Can Java's random function be zero?
body: <p>Just out of curiosity, can Math.random() ever be zero?</p>
  
  <p>For example, if I were to have:</p>
  
  <pre><code>while (true){
    if (Math.random() == 0)
      return 1;
  }
  </code></pre>
  
  <p>Would I ever actually get a return of one? There's also rounding error to consider because Math.random() returns a double.</p>
  
  <p>I ask because my CS professor stated that random() goes from 0 to 1 inclusive, and I always thought it was exclusive. </p>