<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 Apr 14, 2016, at 10:12 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 14, 2016, at 10:36 PM, Stephen Canon &lt;<a href="mailto:scanon@apple.com" class="">scanon@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Erica, thanks for the feedback.</div><br class=""><blockquote type="cite" class="">On Apr 14, 2016, at 6:29 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>&gt; wrote:<br class=""></blockquote><div class=""><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">* I do use % for floating point but not as much as I first thought before I started searching through my code after reading your e-mail. But when I do use it, it's nice to have a really familiar symbol rather than a big word. What were the ways that it was used incorrectly? Do you have some examples?</div></div></div></blockquote><div class=""><br class=""></div>As it happens, I have a rationale sitting around from an earlier (internal) discussion:<br class=""><div class=""><br class=""></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Thanks. That makes plenty of sense although I do still think the name is long and hard to discover compared to fmod[1] and %.</div></div></div></div></blockquote><div><br class=""></div><div>I completely agree. &nbsp;I don’t expect the fmod free function to go away anytime soon, FWIW (and I would oppose removing it unless we had a more discoverable name for this method).</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">* I don't quite get how equatable is going to work. Do you mind explaining that in more detail?</div></div></div></blockquote><br class=""></div><div class="">I’m not totally sure what your question is. &nbsp;Are you asking how FloatingPoint will conform to Equatable, or how the Equatable protocol will work?</div></div></div></blockquote><div class=""><br class=""></div></div>Given the many words and passionate articles about how difficult it is to perform floating point comparisons,&nbsp;<div class="">for example, <a href="https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/" class="">https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/</a>,&nbsp;</div><div class="">I'm just curious as to what approach you've settled on. The topic has come up on-list quite a few times.</div></div></div></blockquote><br class=""></div><div>The actual == and != operators should continue to default to exact (IEEE 754) equality. &nbsp;Doing anything else is asking for a lot of trouble when people try to convert algorithms from other languages.</div><div><br class=""></div><div>Support for equality and comparison with a tolerance would be a great library feature, but the difficulty is that it’s impossible to provide a solution that’s appropriate for all (or even most) cases. &nbsp;I have a few sketches of things I’d like to do in that direction, but it’s out of scope for Swift 3, considering the subtle numerics *and* library/language design issues involved.</div><div><br class=""></div><div>– Steve</div></body></html>