tag:blogger.com,1999:blog-4946490806848569840.post5093721467590707476..comments2023-04-24T16:57:22.851-07:00Comments on R snippets: Sequence generation in R, Python and JuliaUnknownnoreply@blogger.comBlogger5125tag:blogger.com,1999:blog-4946490806848569840.post-46891561980144512962020-10-13T12:10:31.054-07:002020-10-13T12:10:31.054-07:00Completly agree! I think the author misses the poi...Completly agree! I think the author misses the point.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4946490806848569840.post-44985011419278527982015-01-09T06:39:00.528-08:002015-01-09T06:39:00.528-08:00Thx for the comment. However, notice that I use ==...Thx for the comment. However, notice that I use == only to show the results and it is clear that you would not use == in practice.<br /><br />But consider two things (as an example):<br />1) should it matter if you generate from low to hi or from hi to low (I would say it should not matter and in Python it does)<br />2) should you have your generated sequence as evenly spaced as possible (I would say yes and for example in R you have 'just beyond' that breaks this this assumption)Bogumił Kamińskihttps://www.blogger.com/profile/06250268799809238730noreply@blogger.comtag:blogger.com,1999:blog-4946490806848569840.post-58579104520839009552015-01-09T06:06:42.198-08:002015-01-09T06:06:42.198-08:00Hi,
well, maybe I miss the point, why you prefer ...Hi,<br /><br />well, maybe I miss the point, why you prefer Julia. Julia is giving 6 times "false" and R produces 6 times FALSE. Equal. The point is, however, that every programmer should consider using "==" or ".==" with floating point numbers to be bad und to be avoided. Python producing the most unexspected behaviour has the biggest chance, that the programmer notices a bug in his code before delivering or real-case using it. +1 for python. <br />Once you learned to avoid "==" with floats, the topic discussed here is of no relevance anymore (or, is it?).<br /><br />Greets,<br />BernhardAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4946490806848569840.post-2272753680048336752015-01-07T23:57:44.587-08:002015-01-07T23:57:44.587-08:00If you are interested in details you can out this ...If you are interested in details you can out this discussion https://github.com/JuliaLang/julia/issues/9637.Bogumił Kamińskihttps://www.blogger.com/profile/06250268799809238730noreply@blogger.comtag:blogger.com,1999:blog-4946490806848569840.post-27451491312377446982015-01-07T10:46:49.343-08:002015-01-07T10:46:49.343-08:00Julia is designed by people who really cares about...Julia is designed by people who really cares about these kind of issues, so it uses a nice algorithm to make floating point ranges work more intuitively. You should still note that there are fundamental issues with binary floating point numbers and decimal literals in code, so it is probably possible to find edge cases in Julia too.Anonymousnoreply@blogger.com