<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 class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">-August</span>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 18 Dec, 2015, at 15:31, Kevin Ballard via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">


<title class=""></title>

<div class=""><div class="">On Fri, Dec 18, 2015, at 03:04 PM, Chris Lattner via swift-evolution wrote:<br class=""></div>
<blockquote type="cite" class=""><div class="">&nbsp;</div>
<div class=""><blockquote type="cite" class=""><div class="">On Dec 18, 2015, at 3:03 PM, Stephen Canon &lt;<a href="mailto:scanon@apple.com" class="">scanon@apple.com</a>&gt; wrote:<br class=""></div>
<div class="">&nbsp;</div>
<div class=""><div style="word-wrap:break-word;-webkit-line-break:after-white-space;" class=""><div class="">&nbsp;</div>
<div class=""><blockquote type="cite" class=""><div class="">On Dec 18, 2015, at 5:57 PM, Chris Lattner &lt;<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>&gt; wrote:<br class=""></div>
<div class="">&nbsp;</div>
<div class=""><div style="word-wrap:break-word;-webkit-line-break:after-white-space;" class=""><div class="">On Dec 18, 2015, at 1:12 PM, Stephen Canon via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></div>
<div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap:break-word;-webkit-line-break:after-white-space;" class=""><div class="">Hi everybody —<br class=""></div>
<div class="">&nbsp;</div>
<div class="">I’d like to propose removing the “%” operator for floating-point types.<br class=""></div>
</div>
</div>
</blockquote><div class="">&nbsp;</div>
<div class="">I support removing this - it is actively harmful for a surprising operation like this to have such short and inviting syntax. &nbsp;As asked downthread, have you given any thought into whether a Decimal type would support this operation?<br class=""></div>
</div>
</div>
</div>
</blockquote><div class="">&nbsp;</div>
</div>
<div class="">The same concerns apply to decimal. &nbsp;It makes sense to have the operation (for both binary and decimal floating-point) as “Type.remainder(a,b)” or a free function like "remainder(a, b)”, but I would prefer not to use the operator “%” for it because it behaves very differently from integer %, and in ways that are not at all obvious to most users.<br class=""></div>
</div>
</div>
</blockquote><div class="">&nbsp;</div>
</div>
<div class="">Great, I’d prefer decimal and the float types to have a consistent interface where possible. &nbsp;+1 from me on the proposal.<br class=""></div>
</blockquote><div class="">&nbsp;</div>
<div class="">Agreed. +1 from me too. The `10.0 % 0.1` behavior is sufficiently surprising that I think that justifies removal by itself.<br class=""></div>
<div class="">&nbsp;</div>
<div class="">I'm also in favor of adding mod and remainder as instance methods of the floating point types, e.g. `10.0.mod(0.1)` (as opposed to static methods or free functions).<br class=""></div></div></div></blockquote>Shouldn’t that be added to any Arithmetic type?<br class=""><blockquote type="cite" class=""><div class=""><div class="">
<div class="">&nbsp;</div>
<div class="">-Kevin Ballard</div>

<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=YlP5d0-2B1vqer4tMfV-2Fla3oTrv63KR8lPREfeEQWpoVyX-2FXGP5F20Ymu5cvSITMMqonqIdIkfbjfuQWfGOC4yBRadWQugPmSBd2QRmNkoNn-2FpEhbJ5aQP-2FV7btxH8jgbphniGbx1ZBbQ55vPMxgTNO4pCiA0TUJnwFjIZBITgG1UFhFZdkWw9vGY14FNLs0-2B0GC0t3ivjUDdAib9xg2kGFYWZH-2FGIOyw6n6nJIMbDqQ8-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>


_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>