-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Avoid to use floating point match #41292
Conversation
r? @BurntSushi (rust_highfive has picked a reviewer for you, use r? to override) |
src/librand/distributions/gamma.rs
Outdated
_ => Large(GammaLargeShape::new_raw(shape, scale)), | ||
let repr = if shape == 1.0 { | ||
One(Exp::new(1.0 / scale)) | ||
} else if shape > 0.0 && shape < 1.0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be shape >= 0.0
?
(I usually like to write conditions like this with the subject in the middle, e.g., 0.0 <= shape && shape < 1.0
, but YMMV.)
Its going to be forbidden, see issue 41255.
Addressed the comment. |
@bors r+ |
📌 Commit baeec7b has been approved by |
Thanks @est31! (I haven't forgotten about your other PR btw. I'm really hoping to get to it this weekend!) |
Avoid to use floating point match Its going to be forbidden, see issue rust-lang#41255.
Its going to be forbidden, see issue #41255.