-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Range
cannot be inclusive for floats
#394
Comments
It is not clear whether this can be corrected (see dhardy#85 (comment)), but we should at least document it or even panic on |
We already have the following documentation:
So we already say sampling from floating point ranges might be fuzzy at the boundaries (as users probably expect as rounding errors are part of the deal with fp). Do you think we really need to spell things out even more? We could turn the comment from that method into a doc comment... We should definitely not panic. There is no programmer error here and no incorrect results. And we don't want to make using Of course, trying to reduce the rounding error to be more accurate at the boundaries can always be good, but I suspect there is no silver bullet that does not decrease the accuracy in other places. |
Indeed, I don't think there's much we can do here. @vks if you want to make a PR improving doc please do, or we can also reopen this, but I don't see anything constructive here. |
Range::new
andRange::new_inclusive
are currently identical forf32
andf64
.The text was updated successfully, but these errors were encountered: