<!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">
<style type="text/css">
      del { font-weight:bold;background-color:#ffa0a0 }
      ins { font-weight:bold;background-color:#a0ffa0 }
      blockquote {
      display: block;
      font-family: "Times New Roman";
      background-color:lightgray;
      margin-top: 1em;
      margin-bottom: 1em;
      margin-left: 40px;
      margin-right: 40px
      }
</style>

  <title>N2xxx: Decimal math functions</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> 2020-mm-dd<br>
  <b>Document:</b> WG14 N2xxx<br>
  <b>Title:</b> N2xxx: Decimal math functions<br>
  <b>Reference Documents:</b> N1949, N2355, N2377, N2309, N2401,
  N2451, N2478</p>

  <p>Summary: The decimal math functions need more __STDC_
  #define's to be usable.</p>

  <p>Decimal floating-point is optional (N2478 6.10.8.3 Conditional
  feature macros):</p>

  <blockquote>
    <p>__STDC_IEC_60559_DFP__ The integer constant yyyymmL,
    intended to indicate support of decimal floating types and
    conformance to Annex F for IEC 60559 decimal floating-point
    arithmetic.</p>
  </blockquote>

  <p>and Annex F IEC 60559 floating-point arithmetic:</p>

  <blockquote>
    <p>An implementation that defines __STDC_IEC_60559_DFP__ to
    yyyymmL shall conform to the specifications for decimal
    floating-point arithmetic in the following subclauses of this
    annex: ....</p>
  </blockquote>

  <p>Therefore, any use of a decimal facility (such as _Decimal64)
  would need to be enclosed in #ifdef __STDC_IEC_60559_DFP__ ...
  #endif.</p>

  <p>Are the TS 18661-4, Part 4a supplementary math functions
  optional?</p>

  <p>N1949 is TS 18661-4 for publication. Later, for C2X, it was
  broken up into parts.</p>

  <p>N2355 [C11 version] was voted in 2019 May meeting
  (London)[N2377 minutes]. Along with N2309 [rootn bug fix].
  However, N2355 is not a set of detailed changes to C2X.</p>

  <p>N2401 [C17 version] 2019 October meeting (Ithaca)[N2451
  minutes] has the detailed updates to C2X. In part, it has:</p>

  <blockquote>
    <pre>
 2 Conformance
   c) it defines __STDC_IEC_60559_FUNCS__ to 201506L.
</pre>
  </blockquote>

  <p>However, that macro is not mentioned as a change to C2X in
  N2401; it was mentioned as a change to 6.10.8.3#1 in N1949.</p>

  <p>I believe that, to get the decimal part 4a math functions, the
  implementation needs two things.</p>

  <blockquote>
    <pre>
<code>
 #define __STDC_IEC_60559_DFP__
 #define __STDC_IEC_60559_FUNCS__
</code>
</pre>
  </blockquote>

  <p>Also, the user needs two things (as mentioned in N1949):</p>

  <blockquote>
    <pre>
<code>
 #define __STDC_WANT_IEC_60559_DFP_EXT__
 #define __STDC_WANT_IEC_60559_FUNCS_EXT__
</code>
    
</pre>
  </blockquote>
</body>
</html>