-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tests for f32/f64 float methods #22984
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
Wow! |
Is that a good wow or a bad wow? :) |
Definitely a good one! The patch is very comprehensive. |
Yay!!!! Thank you :) |
assert_eq!(0.0, zero); | ||
assert!(!zero.is_infinite()); | ||
assert!(zero.is_finite()); | ||
assert!(zero.is_positive()); |
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.
Hm... not a problem with this patch at all, since this behaviour is documented, but I'm unsure if considering zero to be positive is a great idea. (I filed #22985.)
Maybe you ensure that all the f32
/f64
tests of this nature test both is_positive
and is_negative
, though. I.e. check they're false when they should be, as well as checking that they're true when they should be. (Including the NaN/one ones.)
A few minor comments (I've only put them on |
@huonw Thank you so much for the thorough review! 😻 I added new commits to address your comments; please let me know if you'd like me to squash them down into 902309a :) |
Looks good; squashing would be great. |
Done!! :) |
☔ The latest upstream changes (presumably #23031) made this pull request unmergeable. Please resolve the merge conflicts. |
I was having trouble figuring out which functions had tests and which didn't. This commit is just moving tests around and does not change anything.
@bors thanks for letting me know! ❤️ good bot. |
Building on #22076, I've added some tests for stable methods in f32 and f64 that didn't have any before. Please let me know if there are any improvements I can make, and I am happy to make them! 📬
Building on rust-lang#22076, I've added some tests for stable methods in f32 and f64 that didn't have any before. Please let me know if there are any improvements I can make, and I am happy to make them! 📬
Building on #22076, I've added some tests for stable methods in f32 and f64 that didn't have any before.
Please let me know if there are any improvements I can make, and I am happy to make them! 📬