<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>? I don't see transivity requirement broken here, because -within a comparison tolerance- they still are true. </div><div id="AppleMailSignature"><br><br><br><div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">ted van gaalen <b>it</b> services</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span><div apple-content-edited="true"><div><span style="background-color: rgba(255, 255, 255, 0);">Professional App development for </span></div><div><span style="background-color: rgba(255, 255, 255, 0);">Apple IOS, Windows & Android</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">tablets and mobile phones</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">based on > 30 yrs of IT experience.</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">Web design & programming.</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">IBM Mainframe application programming.</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><div><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);"><a href="http://www.tedvg.com/" target="_blank">www.tedvg.com</a><br></span></font></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">Ted F.A. van Gaalen<br><br></span></div><div><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);"><a href="x-apple-data-detectors://2/0" x-apple-data-detectors="true" x-apple-data-detectors-type="address" x-apple-data-detectors-result="2/0">Hauptstr. 19/3</a><br><a href="x-apple-data-detectors://2/0" x-apple-data-detectors="true" x-apple-data-detectors-type="address" x-apple-data-detectors-result="2/0">D-88636 Illmensee</a><br><a href="x-apple-data-detectors://2/0" x-apple-data-detectors="true" x-apple-data-detectors-type="address" x-apple-data-detectors-result="2/0">Germany</a><br>T: <a href="tel:49%207558%2092%2017%20840" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="2/1">49 7558 92 17 840</a><br>M: <a href="tel:49%20174%207707%20422" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="2/2">49 174 7707 422</a></span></font></div></div></div></div></div></div><div><br>On 01 Mar 2016, at 20:39, Pyry Jahkola <<a href="mailto:pyry.jahkola@iki.fi">pyry.jahkola@iki.fi</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div><blockquote type="cite" class=""><div class="">On 01 Mar 2016, at 20:28, ted van gaalen via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">in relation to my message about handling floating point number comparisation tolerance in e.g. a .stride function, wouldn't this be better handled by a compiler directive?<br class=""><br class="">For example:<br class=""><br class=""> @floatingPointComparisonTolerance = 0.001<br class=""></div></div></blockquote><br class=""></div><div>I don't think it's a good idea. That directive would break the transitivity requirement of <font face="Menlo" class="">Equatable</font> (the last line below):</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>/// **Equality is an equivalence relation**</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">///</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>/// - `x == x` is `true`</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>/// - `x == y` implies `y == x`</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><b class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>/// - `x == y` and `y == z` implies `x == z`</b></div><div class=""><br class=""></div><div>You might want to define another operator or function for approximately equal instead.</div><div><br class=""></div><div><blockquote type="cite" class=""></blockquote></div><div class="">(Not like equality wasn't already broken for floats because of <font face="Menlo" class="">NaN</font>, but at least we can try to keep the remaining semantics sane.)</div><div class=""><br class=""></div><div class="">— Pyry</div></div></div></blockquote></body></html>