If you do [0.1, 0.2 .. 0.3] it should leave out 0.3.  This is floating point numbers and if you don&#39;t understand them, then don&#39;t use them.  The current behaviour of .. for floating point is totally broken, IMO.<div>
<br></div><div>  -- Lennart<br><br><div class="gmail_quote">On Fri, Sep 23, 2011 at 6:06 AM, Chris Smith <span dir="ltr">&lt;<a href="mailto:cdsmith@gmail.com">cdsmith@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, 2011-09-23 at 11:02 +1200, Richard O&#39;Keefe wrote:<br>
&gt; I do think that &#39;..&#39; syntax for Float and Double could be useful,<br>
&gt; but the actual definition is such that, well, words fail me.<br>
&gt; [1.0..3.5] =&gt; [1.0,2.0,3.0,4.0] ????  Why did anyone ever think<br>
&gt; _that_ was a good idea?<br>
<br>
</div>In case you meant that as a question, the reason is this:<br>
<br>
    Prelude&gt; [0.1, 0.2 .. 0.3]<br>
    [0.1,0.2,0.30000000000000004]<br>
<br>
Because of rounding error, an implementation that meets your proposed<br>
law would have left out 0.3 from that sequence, when of course it was<br>
intended to be there.  This is messy for the properties you want to<br>
state, but it&#39;s almost surely the right thing to do in practice.  If the<br>
list is longer, then the most likely way to get it right is to follow<br>
the behavior as currently specified.  Of course it&#39;s messy, but the<br>
world is a messy place, especially when it comes to floating point<br>
arithmetic.<br>
<br>
If you can clear this up with a better explanation of the properties,<br>
great!  But if you can&#39;t, then we ought to reject the kind of thinking<br>
that would remove useful behavior when it doesn&#39;t fit some theoretical<br>
properties that looked nice until you consider the edge cases.<br>
<font color="#888888"><br>
--<br>
Chris<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>