<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [HSW][regression][bisect] RPG Maker game gives "invalid floating point operation" at startup"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=95419#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [HSW][regression][bisect] RPG Maker game gives "invalid floating point operation" at startup"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=95419">bug 95419</a>
              from <span class="vcard"><a class="email" href="mailto:mattst88@gmail.com" title="Matt Turner <mattst88@gmail.com>"> <span class="fn">Matt Turner</span></a>
</span></b>
        <pre>(In reply to dnord from <a href="show_bug.cgi?id=95419#c4">comment #4</a>)
<span class="quote">> Created <span class=""><a href="attachment.cgi?id=123797" name="attach_123797" title="patch2">attachment 123797</a> <a href="attachment.cgi?id=123797&action=edit" title="patch2">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=95419&attachment=123797'>[review]</a> [review]
> patch2

> Sorry, your patch did not helped, but your suggestion is right: it's
> division by zero, when total_wants = 0. This code uses unnecessary math
> tricks for trivial things for some reason. If one does the math it can be
> easily seen, that (remaining_space/total_wants) ratio always remains the
> same, so this error-prone hacky code can be replaced by equivalent clear
> one, which is not prone to division-by-zero errors. Patch attached (works
> for me). Please review.</span >

Thank you. That looks good.

If I might make two suggestions, which you're welcome to do as a follow on
patch: (1) replace the (double) cast with (float) (commit af5ca43 added new
code using doubles, which was a rebasing mistake on top of commit c1da1570),
and (2) use lroundf() instead of round().

Can you please send the patch to <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a> using git
send-email? Also, please make sure git is configured with your name and email.

Thanks!</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>