<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 2, 2017, at 5:10 PM, Stephen Canon via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Nov 2, 2017, at 7:22 PM, Xiaodi Wu via swift-dev &lt;</span><a href="mailto:swift-dev@swift.org" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">swift-dev@swift.org</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">&gt; wrote:</span><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">On Thu, Nov 2, 2017 at 5:22 PM, Matthew Johnson<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:matthew@anandabits.com" target="_blank" class="">matthew@anandabits.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="" style="overflow-wrap: break-word;"><br class=""><div class=""><blockquote type="cite" class=""><span class="gmail-"><div class="">On Nov 2, 2017, at 5:20 PM, Jonathan Hull via swift-dev &lt;<a href="mailto:swift-dev@swift.org" target="_blank" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="gmail-m_9196866851710290294Apple-interchange-newline"></span><div class=""><div class="" style="overflow-wrap: break-word;"><span class="gmail-">It looks like we have a good solution.&nbsp; Per Steve and David’s suggestions:<div class=""><br class=""></div><div class="">1) Make FloatingPoint == reflexive</div><div class=""><br class=""></div><div class="">2) Add &amp;== to FloatingPoint for those who specifically want IEEE behavior</div><div class=""><br class=""></div><div class="">3) Add a warning + fixit to ‘a != a’&nbsp;</div><div class=""><br class=""></div></span><div class="">We should take this to evolution…</div></div></div></blockquote><div class=""><br class=""></div>Looks like a winner to me.</div></div></blockquote><div class=""><br class=""></div><div class="">Again, there remain several problems with this design. In the concrete context, the syntax `&amp;==` suggests that it is a compatibility, legacy, or specialized function not to be preferred over `==`. This makes Swift deviate from every other programming language, creating a new footgun for experienced developers, and encourages a performance hit where one is not demonstrably necessary (most operations that ask about UI coordinates, say, will never have NaN as an input).</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">This is a real concern, which I don’t think can be dismissed easily. It’s really the only major concern that I have, however.</div></div></div></div></blockquote></div><br class=""><div class="">If performance is a big concern, I think we can reclaim it in many common use cases with just a little help from the compiler. &nbsp;Basically, if there are cases that can be guaranteed not to have NaN (e.g. a literal), then we can just use the machine instruction.</div><div class=""><br class=""></div><div class="">Also, we could consider moving &amp;== from FloatingPoint to Numeric.&nbsp;</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jon</div></body></html>