<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for OS/2 (vers 1 September 2005), see www.w3.org">

  <title>N21zz C2X Proposal: Default rounding mode</title>
</head>

<body>
  <p><br>
  <!-- Who are the authors... -->
   <b>Submitter:</b>Fred J. Tydeman<br>
  <!-- What is the date of submission. yyyy-mm-dd -->
   <b>Submission Date:</b>2017-03-03<br>
  <b>Document:</b> WG14 N21zz<br></p>

  <p>Problem being solved</p>

  <p>C11 makes several references to "default rounding mode". Yet,
  there is no symbol for that mode. Also, the default rounding mode
  need not be <b>FE_TONEAREST</b> (for example, IBM S/360 hex
  floating-point is <b>FE_TOWARDZERO</b>).</p>

  <p>Solution</p>

  <p>In 7.6 paragraph 8, change</p>

  <blockquote>
    <p>Each of the macros</p>
    <pre>
<b>
FE_DOWNWARD
FE_TONEAREST
FE_TOWARDZERO
FE_UPWARD
</b>
</pre>
  </blockquote>to:

  <blockquote>
    <p>Each of the macros</p>
    <pre>
<b>
FE_DOWNWARD
FE_TONEAREST
FE_TOWARDZERO
FE_UPWARD
FE_DEFAULT
</b>
</pre>
  </blockquote>

  <p>and change:</p>

  <blockquote>
    <p>The defined macros expand to integer constant expressions
    whose values are distinct nonnegative values.211)</p>
  </blockquote>

  <p>to:</p>

  <blockquote>
    <p>The defined macros (except for <b>FE_DEFAULT</b>) expand to
    integer constant expressions whose values are distinct
    nonnegative values.211) <b>FE_DEFAULT</b> expands to a value of
    one of the other <b>FE_*</b> macros and is the default rounding
    mode.</p>
  </blockquote>

  <p>Add <b>FE_DEFAULT</b> to B.5 after <b>FE_TONEAREST</b>.</p>

  <p>Add <b>FE_DEFAULT</b> to F.3 item about <b>fegetround</b>
  before <b>FE_TONEAREST</b>.</p>

  <p>Add <b>FE_DEFAULT</b> macro, <b>7.6</b> to the index.</p>
</body>
</html>