<div dir="ltr">I just grabbed two separate witnesses showing the result of the relevant floating point math - I apologize for any offense.<br><br><div class="gmail_quote">On Tue Feb 24 2015 at 1:15:01 PM Matthias Felleisen <<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
That's the saddest argument in support of anything Racket I have ever seen (even with the smiley).<br>
<br>
<br>
On Feb 24, 2015, at 1:05 PM, Andrew Kent <<a href="mailto:andmkent@indiana.edu" target="_blank">andmkent@indiana.edu</a>> wrote:<br>
<br>
> Racket:<br>
> (+ .1 .1 .1 .1 .1 .1 .1 .1)<br>
> 0.7999999999999999<br>
><br>
> Python:<br>
> >>> .1 + .1 + .1 + .1 + .1 + .1 + .1 + .1<br>
><br>
> 0.7999999999999999<br>
><br>
> Looks consistent to me =)<br>
><br>
><br>
> On Tue Feb 24 2015 at 10:43:19 AM Laurent <<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>> wrote:<br>
> I've discovered a rather troubling behaviour when using `in-range` with floating point numbers, which I think is worth knowing in case you hadn't consider the issue before:<br>
><br>
> On my machine, I get the following:<br>
><br>
> (length (for/list ([i (in-range .1 .7 .1)]) i)) ; 6<br>
> (length (for/list ([i (in-range .1 .8 .1)]) i)) ; 8 (!)<br>
><br>
> But:<br>
> (length (for/list ([i (in-range 1/10 7/10 1/10)]) i)) ; 6<br>
> (length (for/list ([i (in-range 1/10 8/10 1/10)]) i)) ; 7<br>
><br>
><br>
> Would it be a good idea to safe-guard these kinds of cases directly in `in-range`?<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
<br>
</blockquote></div></div>