<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 2012-Dec-22 23:53 , Programmingkid
      wrote:<br>
    </div>
    <blockquote
      cite="mid:9A92B721-7DC6-4633-8CA5-20FA666BD825@gmail.com"
      type="cite">
      <pre wrap="">Division by zero equals zero. 
</pre>
    </blockquote>
    <br>
    That is incorrect. By definition, division by zero cannot return a
    meaningful answer. <br>
    <br>
    <a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Division_by_zero">http://en.wikipedia.org/wiki/Division_by_zero</a><br>
    <br>
    [...]<br>
    <blockquote type="cite">In computer programming, an attempt to
      divide a floating point number by zero will by default lead to
      positive or negative infinity by the IEEE 754 floating point
      standard. However, depending on the programming environment and
      the type of number (e.g. integer) being divided by zero, it may:
      generate an exception, generate an error message, cause the
      program to terminate, generate either positive or negative
      infinity, or result in a special not-a-number value.</blockquote>
    <br>
    There are two mathematical theorems in conflict when dividing zero
    by zero;<br>
    <ul>
      <li>Dividing by zero cannot return a meaningful number, since for
        all a/b = x there must be a corresponding x*b = a. If b is zero,
        there is no value of x which can produce a meaningful a.</li>
      <li>Dividing anything by itself (in this case, 0/0) <i>shall</i>
        produce the identity, which for real numbers is 1 (it's
        something else for matrices). Specifically a/a = 1, thus 1*a =
        a.</li>
    </ul>
    <p>The answer is that as far as mathematics (and standards like IEEE
      754) are concerned, dividing 0 by 0 is either a trap or a NaN. Not
      zero. if Apple hardware is producing zero as a result of dividing
      zero by zero, I'd consider that buggy hardware.<br>
    </p>
    <p>I do note from a Google search that at least the PowerPC 8360
      does the correct thing with divide by zero, which breaks someone's
      application that depended on different behaviour:<br>
    </p>
    <p><a class="moz-txt-link-freetext" href="http://stackoverflow.com/questions/6460558/powerpc-how-to-make-div-0-return-zero-as-a-result">http://stackoverflow.com/questions/6460558/powerpc-how-to-make-div-0-return-zero-as-a-result</a><br>
    </p>
    <p>I do find amusing the comment about the original dependency on
      1/0 producing 0:<br>
      <br>
      <blockquote type="cite">I've inherited legacy code like this
        before & I feel your pain. You want to shake your fist at
        the people who installed such bone-headed behavior, but right
        now shaking your fist doesn't help you ship product. You need a
        solution. Good luck.</blockquote>
      <br>
    </p>
  </body>
</html>