<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jan 26, 2023, at 9:36 AM, Brian Goetz <<a href="mailto:brian.goetz@oracle.com" class="">brian.goetz@oracle.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class=""><font size="4" class=""><font face="monospace" class="">... <br class="">
<br class="">
For comparing a variable to a constant, representational equality is the obvious interpretation; `case nnn` means "is it the number nnn".  This allows you to say `case NaN` and `case -0` and get the right answer (all of these relations agree on what to do about
 1.0).  <br class="">
</font></font></div>
</div>
</blockquote>
<br class="">
</div>
<div>Careful: I think you had better say “<font face="Menlo" class=""><span style="font-style: normal;" class="">case -0.0</span></font>”; otherwise the constant expression “<font face="Menlo" class=""><span style="font-style: normal;" class="">-0</span></font>”
 will be reduced to “<font face="Menlo" class=""><span style="font-style: normal;" class="">0</span></font>” and only then converted to floating-point representation, producing
<font face="Menlo" class=""><span style="font-style: normal;" class="">+0.0</span></font>.</div>
<div class=""><br class="">
</div>
Yes, floating-point is VERY fiddly.
<div class=""><br class="">
<style style="display:none;" class="">P {margin-top:0;margin-bottom:0;}</style>
<div class="">—Guy</div>
<div class=""><br class="">
</div>
</div>
</body>
</html>