<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">It does not produce the through value because that is how strides currently work. There's a second proposal to handle the through value.</div><div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 1, 2016, at 12:44 AM, Howard Lovatt &lt;<a href="mailto:howard.lovatt@gmail.com" class="">howard.lovatt@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Your implementation of `fstride` is faulty, it doesn't produce the `through` value. Suggest you change to:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class="">public<span style="" class=""> </span>extension<span style="" class=""> </span><span style="color:rgb(112,61,170)" class="">Double</span><span style="" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">public</span> <span style="color:rgb(187,44,162)" class="">func</span> doubleStride(through end: <span style="color:rgb(112,61,170)" class="">Double</span>, by stride: <span style="color:rgb(112,61,170)" class="">Double</span>) -&gt; <span style="color:rgb(112,61,170)" class="">LazyMapCollection</span>&lt;<span style="color:rgb(112,61,170)" class="">Range</span>&lt;<span style="color:rgb(112,61,170)" class="">Int</span>&gt;, <span style="color:rgb(112,61,170)" class="">Double</span>&gt; {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">let</span> limit = <span style="color:rgb(112,61,170)" class="">Int</span>(<span style="color:rgb(61,29,129)" class="">trunc</span>((end - <span style="color:rgb(187,44,162)" class="">self</span>) / stride))</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">return</span> (<span style="color:rgb(39,42,216)" class="">0</span> ... limit).<span style="color:rgb(112,61,170)" class="">lazy</span>.<span style="color:rgb(61,29,129)" class="">map</span> { <span style="color:rgb(187,44,162)" class="">self</span> + <span style="color:rgb(112,61,170)" class="">Double</span>($0) * stride }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature">&nbsp; -- Howard.<br class=""></div></div>
<br class=""><div class="gmail_quote">On 1 March 2016 at 12:16, Erica Sadun via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><h1 style="font-size:2.25em;margin-right:0px;margin-bottom:16px;margin-left:0px;line-height:1.2;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';background-color:rgb(255,255,255);margin-top:0px!important" class=""><blockquote type="cite" style="font-family:Palatino;font-size:14px;font-weight:normal" class=""><div style="word-wrap:break-word" class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 29, 2016, at 5:03 PM, Joe Groff &lt;<a href="mailto:jgroff@apple.com" target="_blank" class="">jgroff@apple.com</a>&gt; wrote:</div><div class=""><div style="font-family:Palatino-Roman" class="">I agree, splitting into two proposals is a good idea.</div><div style="font-family:Palatino-Roman" class=""><br class=""></div><div style="font-family:Palatino-Roman" class="">-Joe</div></div></blockquote></div></div></blockquote></h1><h1 style="font-size:2.25em;margin-right:0px;margin-bottom:16px;margin-left:0px;line-height:1.2;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';background-color:rgb(255,255,255);margin-top:0px!important" class="">Decoupling Floating Point Strides from Generic Implementations</h1><ul style="padding:0px 0px 0px 2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><li class="">Proposal: SE-00XX</li><li class="">Author(s):&nbsp;<a href="http://github.com/erica" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank" class="">Erica Sadun</a></li><li class="">Status: TBD</li><li class="">Review manager: TBD</li></ul><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">Swift strides create progressions along "notionally continuous one-dimensional values" using a series of offset values. This proposal replaces the Swift's generic stride implementation with seperate algorithms for integer strides (the current implementation) and floating point strides.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">This proposal was discussed on-list in the&nbsp;<a href="http://article.gmane.org/gmane.comp.lang.swift.evolution/8014" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank" class="">"[Discussion] stride behavior and a little bit of a call-back to digital numbers"</a>thread.</p><h2 style="margin-top:1em;margin-bottom:16px;line-height:1.225;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';background-color:rgb(255,255,255)" class=""><a href="https://gist.github.com/erica/cf50f3dc54bb3a090933#motivation" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none;display:inline-block;padding-right:2px;line-height:1" target="_blank" class=""><u class=""></u><u class=""></u><u class=""></u><u class=""></u></a>Motivation</h2><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">Strideable</code>&nbsp;is genericized across both integer and floating point types. A single implementation causes floating point strides to accumulate errors through repeatedly adding&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">by</code>&nbsp;intervals. Floating point types deserve their own floating point-aware implementation that minimizes errors.</p><h2 style="margin-top:1em;margin-bottom:16px;line-height:1.225;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';background-color:rgb(255,255,255)" class=""><a href="https://gist.github.com/erica/cf50f3dc54bb3a090933#current-art" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none;display:inline-block;padding-right:2px;line-height:1" target="_blank" class=""><u class=""></u><u class=""></u><u class=""></u><u class=""></u></a>Current Art</h2><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">A&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">Strideable to</code>&nbsp;sequence returns the sequence of values (<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">self</code>,&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">self + stride</code>,&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">self + stride + stride</code>, ...&nbsp;<em class="">last</em>) where&nbsp;<em class="">last</em>&nbsp;is the last value in the progression that is less than&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">end</code>.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">A&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">Strideable through</code>&nbsp;sequence currently returns the sequence of values (<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">self</code>,&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">self + stride</code>,&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">self + tride + stride</code>, ...&nbsp;<em class="">last</em>) where&nbsp;<em class="">last</em>&nbsp;is the last value in the progression less than or equal to&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">end</code>. There is no guarantee that&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">end</code>&nbsp;is an element of the sequence.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">While floating point calls present an extremely common use-case, they use integer-style math that accumulates errors during execution. Consider this example:</p><div style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:0px;line-height:1.45;padding:16px;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;word-break:normal" class=""><span style="color:rgb(167,29,93)" class="">let</span> ideal <span style="color:rgb(167,29,93)" class="">=</span> [<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">2</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">3</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">4</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">5</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">6</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">7</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">8</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">9</span>, <span style="color:rgb(0,134,179)" class="">2</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>]
<span style="color:rgb(0,134,179)" class="">print</span>(<span style="color:rgb(0,134,179)" class="">zip</span>(<span style="color:rgb(0,134,179)" class="">Array</span>(<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">stride</span>(through: <span style="color:rgb(0,134,179)" class="">2</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">01</span>, by: <span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>)), ideal)<span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">map</span>(<span style="color:rgb(167,29,93)" class="">-</span>))
<span style="color:rgb(150,152,150)" class="">// prints [0.0, 0.0, 2.2204460492503131e-16, 2.2204460492503131e-16, </span>
<span style="color:rgb(150,152,150)" class="">// 4.4408920985006262e-16, 4.4408920985006262e-16, 4.4408920985006262e-16, </span>
<span style="color:rgb(150,152,150)" class="">// 6.6613381477509392e-16, 6.6613381477509392e-16, 8.8817841970012523e-16, </span>
<span style="color:rgb(150,152,150)" class="">// 8.8817841970012523e-16]</span></pre></div><ul style="padding:0px 0px 0px 2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><li class="">To create an array containing values from 1.0 to 2.0, the developer must add an epsilon value to the&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">through</code>argument. Otherwise the stride progression ends near 1.9. Increasing the argument from&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">2.0</code>&nbsp;to&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">2.01</code>&nbsp;is sufficient to include the end value.</li><li class="">The errors in the sequence increase over time. You see this as errors become larger towards the end of the progress. This is an artifact of the generic implementation.</li></ul><h2 style="margin-top:1em;margin-bottom:16px;line-height:1.225;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';background-color:rgb(255,255,255)" class=""><a href="https://gist.github.com/erica/cf50f3dc54bb3a090933#detail-design" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none;display:inline-block;padding-right:2px;line-height:1" target="_blank" class=""><u class=""></u><u class=""></u><u class=""></u><u class=""></u></a>Detail Design</h2><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">Under the current implementation, each floating point addition in a generic stride accrues errors. The following progression never reaches 2.0.</p><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;margin-top:0px;margin-bottom:16px;line-height:1.45;padding:16px;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;color:rgb(51,51,51)" class=""><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;line-height:inherit;word-wrap:normal" class="">print(Array(1.0.stride(through: 2.0, by: 0.1)))
// Prints [1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9]
</code></pre><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">This same issue occurs with traditional C-style for loops. This is an artifact of floating point math, and not the specific Swift statements:</p><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;margin-top:0px;margin-bottom:16px;line-height:1.45;padding:16px;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;color:rgb(51,51,51)" class=""><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;line-height:inherit;word-wrap:normal" class="">var array: [Double] = []
for var i = 1.0; i &lt;= 2.0; i += 0.1 {
    array.append(i)
}
print("Array", array) 
// Prints Array [1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9]
</code></pre><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">You should not have to manually add an epsilon to force a progression to complete.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">Floating point strides are inherently dissimilar to and should not be genericized with integer strides. I propose separate their implementation, freeing them to provide their own specialized progressions, using better numeric methods. In doing so, floating point values are no longer tied to implementations that unnecessarily accrue errors or otherwise provide less-than-ideal solutions.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">The following example provides a rough pass at what this might look like for floating point math. I leave specific algorithm details to experts; a decimal number solution would be more appropriate. The fun</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">See:&nbsp;<a href="https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank" class="">RandomAscii's write-ups on all things floating point</a>.</p><div style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:0px;line-height:1.45;padding:16px;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;word-break:normal" class=""><span style="color:rgb(167,29,93)" class="">import</span> <span style="color:rgb(0,134,179)" class="">Darwin</span>

<span style="color:rgb(150,152,150)" class="">/// A `GeneratorType` for `DoubleStrideThrough`.</span>
<span style="color:rgb(167,29,93)" class="">public</span> <span style="color:rgb(167,29,93)" class="">struct</span> DoubleStrideThroughGenerator <span style="color:rgb(167,29,93)" class="">:</span> <span style="color:rgb(0,134,179)" class="">GeneratorType</span> {
    <span style="color:rgb(167,29,93)" class="">let</span> start: <span style="color:rgb(0,134,179)" class="">Double</span>
    <span style="color:rgb(167,29,93)" class="">let</span> end: <span style="color:rgb(0,134,179)" class="">Double</span>
    <span style="color:rgb(167,29,93)" class="">let</span> <span style="color:rgb(0,134,179)" class="">stride</span>: <span style="color:rgb(0,134,179)" class="">Double</span>
    <span style="color:rgb(167,29,93)" class="">var</span> iteration: <span style="color:rgb(0,134,179)" class="">Int</span> <span style="color:rgb(167,29,93)" class="">=</span> <span style="color:rgb(0,134,179)" class="">0</span>
    <span style="color:rgb(167,29,93)" class="">var</span> done: <span style="color:rgb(0,134,179)" class="">Bool</span> <span style="color:rgb(167,29,93)" class="">=</span> <span style="color:rgb(0,134,179)" class="">false</span>

    <span style="color:rgb(167,29,93)" class="">public</span> <span style="color:rgb(167,29,93)" class="">init</span>(start: <span style="color:rgb(0,134,179)" class="">Double</span>, end: <span style="color:rgb(0,134,179)" class="">Double</span>, <span style="color:rgb(0,134,179)" class="">stride</span>: <span style="color:rgb(0,134,179)" class="">Double</span>) {
        (<span style="color:rgb(167,29,93)" class="">self</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">start</span>, <span style="color:rgb(167,29,93)" class="">self</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">end</span>, <span style="color:rgb(167,29,93)" class="">self</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">stride</span>) <span style="color:rgb(167,29,93)" class="">=</span> (start, end, <span style="color:rgb(0,134,179)" class="">stride</span>)
    }

    <span style="color:rgb(150,152,150)" class="">/// Advance to the next element and return it, or `nil` if no next</span>
    <span style="color:rgb(150,152,150)" class="">/// element exists.</span>
    <span style="color:rgb(167,29,93)" class="">public</span> <span style="color:rgb(167,29,93)" class="">mutating</span> <span style="color:rgb(167,29,93)" class="">func</span> <span style="color:rgb(121,93,163)" class="">next</span>() <span style="color:rgb(167,29,93)" class="">-&gt;</span> <span style="color:rgb(0,134,179)" class="">Double</span>? {
        <span style="color:rgb(167,29,93)" class="">if</span> done {
            <span style="color:rgb(167,29,93)" class="">return</span> <span style="color:rgb(0,134,179)" class="">nil</span>
        }
        <span style="color:rgb(167,29,93)" class="">let</span> current <span style="color:rgb(167,29,93)" class="">=</span> start <span style="color:rgb(167,29,93)" class="">+</span> <span style="color:rgb(0,134,179)" class="">Double</span>(iteration) <span style="color:rgb(167,29,93)" class="">*</span> <span style="color:rgb(0,134,179)" class="">stride</span>; iteration <span style="color:rgb(167,29,93)" class="">+=</span> <span style="color:rgb(0,134,179)" class="">1</span>
        <span style="color:rgb(167,29,93)" class="">if</span> signbit(current <span style="color:rgb(167,29,93)" class="">-</span> end) <span style="color:rgb(167,29,93)" class="">==</span> signbit(<span style="color:rgb(0,134,179)" class="">stride</span>) { <span style="color:rgb(150,152,150)" class="">// thanks Joe Groff</span>
            <span style="color:rgb(167,29,93)" class="">if</span> <span style="color:rgb(0,134,179)" class="">abs</span>(current) <span style="color:rgb(167,29,93)" class="">&gt;</span> <span style="color:rgb(0,134,179)" class="">abs</span>(end) {
                done <span style="color:rgb(167,29,93)" class="">=</span> <span style="color:rgb(0,134,179)" class="">true</span>
                <span style="color:rgb(167,29,93)" class="">return</span> current
            }
            <span style="color:rgb(167,29,93)" class="">return</span> <span style="color:rgb(0,134,179)" class="">nil</span>
        }
        <span style="color:rgb(167,29,93)" class="">return</span> current
    }
}

<span style="color:rgb(167,29,93)" class="">public</span> <span style="color:rgb(167,29,93)" class="">struct</span> DoubleStrideThrough <span style="color:rgb(167,29,93)" class="">:</span> <span style="color:rgb(0,134,179)" class="">SequenceType</span> {
    <span style="color:rgb(167,29,93)" class="">let</span> start: <span style="color:rgb(0,134,179)" class="">Double</span>
    <span style="color:rgb(167,29,93)" class="">let</span> end: <span style="color:rgb(0,134,179)" class="">Double</span>
    <span style="color:rgb(167,29,93)" class="">let</span> <span style="color:rgb(0,134,179)" class="">stride</span>: <span style="color:rgb(0,134,179)" class="">Double</span>

    <span style="color:rgb(150,152,150)" class="">/// Return a *generator* over the elements of this *sequence*.</span>
    <span style="color:rgb(150,152,150)" class="">///</span>
    <span style="color:rgb(150,152,150)" class="">/// - Complexity: O(1).</span>
    <span style="color:rgb(167,29,93)" class="">public</span> <span style="color:rgb(167,29,93)" class="">func</span> <span style="color:rgb(121,93,163)" class="">generate</span>() <span style="color:rgb(167,29,93)" class="">-&gt;</span> DoubleStrideThroughGenerator {
        <span style="color:rgb(167,29,93)" class="">return</span> DoubleStrideThroughGenerator(
            start: start, end: end, <span style="color:rgb(0,134,179)" class="">stride</span>: <span style="color:rgb(0,134,179)" class="">stride</span>)
    }

    <span style="color:rgb(167,29,93)" class="">init</span>(start: <span style="color:rgb(0,134,179)" class="">Double</span>, end: <span style="color:rgb(0,134,179)" class="">Double</span>, <span style="color:rgb(0,134,179)" class="">stride</span>: <span style="color:rgb(0,134,179)" class="">Double</span>) {
        _precondition(<span style="color:rgb(0,134,179)" class="">stride</span> <span style="color:rgb(167,29,93)" class="">!=</span> <span style="color:rgb(0,134,179)" class="">0</span>, <span style="color:rgb(24,54,145)" class=""><span class="">"</span>stride size must not be zero<span class="">"</span></span>)
        (<span style="color:rgb(167,29,93)" class="">self</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">start</span>, <span style="color:rgb(167,29,93)" class="">self</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">end</span>, <span style="color:rgb(167,29,93)" class="">self</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">stride</span>) <span style="color:rgb(167,29,93)" class="">=</span> (start, end, <span style="color:rgb(0,134,179)" class="">stride</span>)
    }

}

<span style="color:rgb(167,29,93)" class="">public</span> <span style="color:rgb(167,29,93)" class="">extension</span> <span style="color:rgb(0,134,179)" class="">Double</span> {
    <span style="color:rgb(167,29,93)" class="">public</span> <span style="color:rgb(167,29,93)" class="">func</span> <span style="color:rgb(121,93,163)" class="">fstride</span>(
        <span style="color:rgb(121,93,163)" class="">through</span> <span class="">end</span>: <span style="color:rgb(0,134,179)" class="">Double</span>, <span style="color:rgb(121,93,163)" class="">by</span> <span class="">stride</span>: <span style="color:rgb(0,134,179)" class="">Double</span>
        ) <span style="color:rgb(167,29,93)" class="">-&gt;</span> DoubleStrideThrough {
        <span style="color:rgb(167,29,93)" class="">return</span> DoubleStrideThrough(
            start: <span style="color:rgb(167,29,93)" class="">self</span>, end: end, <span style="color:rgb(0,134,179)" class="">stride</span>: <span style="color:rgb(0,134,179)" class="">stride</span>)
    }
}</pre></div><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">This implementation reduces floating point error by limiting accumulated additions. It uses the current Swift 2.2&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">through</code>&nbsp;semantics (versus the revised&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">through</code>&nbsp;semantics proposed under separate cover), so it never reaches 2.0 without adding an epsilon value.</p><div style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:0px;line-height:1.45;padding:16px;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;word-break:normal" class=""><span style="color:rgb(0,134,179)" class="">print</span>(<span style="color:rgb(0,134,179)" class="">Array</span>(<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span>fstride(through: <span style="color:rgb(0,134,179)" class="">2</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>, by: <span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>)))
<span style="color:rgb(150,152,150)" class="">// prints [1.0, 1.1000000000000001, 1.2, 1.3, 1.3999999999999999,</span>
<span style="color:rgb(150,152,150)" class="">//         1.5, 1.6000000000000001, 1.7000000000000002, 1.8, </span>
<span style="color:rgb(150,152,150)" class="">//         1.8999999999999999]</span>

<span style="color:rgb(150,152,150)" class="">// versus the old style</span>
<span style="color:rgb(0,134,179)" class="">print</span>(<span style="color:rgb(0,134,179)" class="">Array</span>(<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">stride</span>(through: <span style="color:rgb(0,134,179)" class="">2</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>, by: <span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>)))
<span style="color:rgb(150,152,150)" class="">// prints [1.0, 1.1000000000000001, 1.2000000000000002, 1.3000000000000003, </span>
<span style="color:rgb(150,152,150)" class="">//         1.4000000000000004, 1.5000000000000004, 1.6000000000000005, </span>
<span style="color:rgb(150,152,150)" class="">//         1.7000000000000006, 1.8000000000000007, 1.9000000000000008]</span>

<span style="color:rgb(0,134,179)" class="">print</span>(<span style="color:rgb(0,134,179)" class="">zip</span>(<span style="color:rgb(0,134,179)" class="">Array</span>(<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">stride</span>(through: <span style="color:rgb(0,134,179)" class="">2</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>, by: <span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>)), 
          <span style="color:rgb(0,134,179)" class="">Array</span>(<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span>fstride(through: <span style="color:rgb(0,134,179)" class="">2</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>, by: <span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>)))<span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">map</span>(<span style="color:rgb(167,29,93)" class="">-</span>))
<span style="color:rgb(150,152,150)" class="">// prints [0.0, 0.0, 2.2204460492503131e-16, 2.2204460492503131e-16, </span>
<span style="color:rgb(150,152,150)" class="">//         4.4408920985006262e-16, 4.4408920985006262e-16, 4.4408920985006262e-16, </span>
<span style="color:rgb(150,152,150)" class="">//         4.4408920985006262e-16, 6.6613381477509392e-16, 8.8817841970012523e-16]</span>

<span style="color:rgb(167,29,93)" class="">let</span> ideal <span style="color:rgb(167,29,93)" class="">=</span> [<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">2</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">3</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">4</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">5</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">6</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">7</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">8</span>, <span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">9</span>]
<span style="color:rgb(0,134,179)" class="">print</span>(<span style="color:rgb(0,134,179)" class="">zip</span>(<span style="color:rgb(0,134,179)" class="">Array</span>(<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span>fstride(through: <span style="color:rgb(0,134,179)" class="">2</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>, by: <span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>)), ideal)<span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">map</span>(<span style="color:rgb(167,29,93)" class="">-</span>))
<span style="color:rgb(0,134,179)" class="">print</span>(<span style="color:rgb(0,134,179)" class="">zip</span>(<span style="color:rgb(0,134,179)" class="">Array</span>(<span style="color:rgb(0,134,179)" class="">1</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">stride</span>(through: <span style="color:rgb(0,134,179)" class="">2</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">0</span>, by: <span style="color:rgb(0,134,179)" class="">0</span><span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">1</span>)), ideal)<span style="color:rgb(167,29,93)" class="">.</span><span style="color:rgb(0,134,179)" class="">map</span>(<span style="color:rgb(167,29,93)" class="">-</span>))

<span style="color:rgb(150,152,150)" class="">// prints</span>
<span style="color:rgb(150,152,150)" class="">// [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.2204460492503131e-16, 0.0, 0.0]</span>
<span style="color:rgb(150,152,150)" class="">// [0.0, 0.0, 2.2204460492503131e-16, 2.2204460492503131e-16, </span>
<span style="color:rgb(150,152,150)" class="">//  4.4408920985006262e-16, 4.4408920985006262e-16, 4.4408920985006262e-16, </span>
<span style="color:rgb(150,152,150)" class="">//  6.6613381477509392e-16, 6.6613381477509392e-16, 8.8817841970012523e-16]</span></pre></div><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">If one were looking for a quick and dirty fix, the same kind of math used in this rough solution (<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">let value = start + count * interval</code>) could be adopted back into the current generic implementation.</p><h2 style="margin-top:1em;margin-bottom:16px;line-height:1.225;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';background-color:rgb(255,255,255)" class=""><a href="https://gist.github.com/erica/cf50f3dc54bb3a090933#alternatives-considered" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none;display:inline-block;padding-right:2px;line-height:1" target="_blank" class=""><u class=""></u><u class=""></u><u class=""></u><u class=""></u></a>Alternatives Considered</h2><div style="margin-top:0px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255);margin-bottom:0px!important" class="">While precision math for decimal numbers would be better addressed by introducing a decimal type and/or warnings for at-risk floating point numbers, those features lie outside the scope of this proposal.</div><div class=""><br class=""></div><br class=""></div><br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>