title: Floating Point, is an equality comparison enough to prevent division by zero?
body: <pre><code>// value will always be in the range of [0.0 - maximum]
  
  float obtainRatio(float value, float maximum){
      if(maximum != 0.f){
          return value / maximum;  
      }else{
          return 0.f;
      }
  }
  </code></pre>
  
  <p>The range of <code>maximum</code> can be anything, including negative numbers.  The range of <code>value</code> can also be anything, though the function is only required to make "sense" when the input is in the range of <code>[0.0 - maximum]</code>.  The output should always be in the range of <code>[0.0 - 1.0]</code></p>
  
  <p>I have two questions that I'm wondering about, with this:</p>
  
  <ul>
  <li>Is this equality comparison enough to ensure the function never divides by zero?</li>
  <li>If maximum is a degenerate value (extremely small or extremely large), is there a chance the function will return a result outside of [0.0 - 1.0] (assuming value is in the right range)?</li>
  </ul>