<!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>Nxxxx: SNAN: initialization and unary +</title>
</head>
<body>
<p><br>
<!-- Who are the authors... -->
<b>Submitter:</b>Fred Tydeman<br>
<!-- What is the date of submission. yyyy-mm-dd -->
<b>Submission Date:</b> 2019-04-24<br>
<b>Document:</b> WG14 Nxxxx<br>
<b>Reference Documents:</b> CFP emails 1247, 1249, 1250, 1253</p>
<p>Summary</p>
<p>Since unary minus does not trigger an SNAN, it seems that
-SNAN should be valid where ever SNAN is allowed.</p>
<p>Since -SNAN raises no floating-point exceptions, what about
+SNAN?</p>
<p>Is +SNAN a copy operation?</p>
<p>The standard appears to be ambiguous as to what is a valid
signaling NaN initializer.</p>
<p>Is <code>static float f = -SNANF;</code> {required / allowed /
prohibited} to be a signaling NaN?</p>
<p>Does "is used for initializing" include being in any
expression that is used as an initializer, or just being the
initializer? The former would include not only -SNANF but also
1.0 + SNAN.</p>
<p>Possible Technical Corrigendum:</p>
<p>Change 7.12#7 from</p>
<p>If a signaling NaN macro is used for initializing an object of
the same type that has static or thread-local storage duration,
the object is initialized with a signaling NaN value.</p>
<p>to</p>
<p>If a signaling NaN macro <ins>(with an optional + or -
sign)</ins> is used <ins>as the initializer</ins> for
initializing an object of the same type that has static or
thread-local storage duration, the object is initialized with a
signaling NaN value.</p>
<p>Change Annex F.3 [4] from</p>
<p>The unary - operator raises no floating-point exceptions, even
if the operand is a signaling NaN.</p>
<p>to</p>
<p>The unary - <ins>and +</ins> <del>operator</del>
<ins>operators</ins> raise no floating-point exceptions, even if
the operand is a signaling NaN.</p>
<p>Change unary + in F.3 operations table from</p>
<pre>
copy memcpy, memmove,
</pre>to
<pre>
copy memcpy, memmove, <ins>+(x)</ins>
</pre>
<p>Existing practice</p>
<p>clang appears to allow any expression with an SNAN macro as
being an SNAN. gcc appears to only allow SNAN, +SNAN, -SNAN as
being an SNAN.</p>
</body>
</html>