<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - APFloat does not correctly handle signaling NaN"
   href="https://llvm.org/bugs/show_bug.cgi?id=30781">30781</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>APFloat does not correctly handle signaling NaN
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dan@su-root.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>According to IEEE-754 2008 (7.2 Invalid operation) "any general-computational
or signaling-computational operation on a signaling NaN" should generate an
invalid operation exception and return a quiet NaN.

APFloat is supposed to be IEEE-754 2008 compliant but it does not handle this
part of the spec correctly. Currently if it performs an operation on a
signaling NaN it returns `APFloat::opOK` and a signaling NaN. Instead it should
return `APFloat::opInvalidOp` and a quiet NaN.

It appears this limitation is known about because in
`unittests/ADT/APFloatTest.cpp` there is this comment

```
  // TODOS/NOTES:
  // 1. Since we perform only default exception handling all operations with
  // signaling NaNs should have a result that is a quiet NaN. Currently they
  // return sNaN.
```

I couldn't find an open bug specifically for this issue so I'm opening this
one.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>