-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Deduplicated float tests and unified in floats/mod.rs #148206
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
base: main
Are you sure you want to change the base?
Conversation
|
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Any update @bjorn3 ? |
|
CI is still failing. |
ok let me fix . |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
b802b19 to
abd73fd
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| let inf: Float = Float::INFINITY; | ||
| let neg_inf: Float = Float::NEG_INFINITY; | ||
| assert_biteq!((10.0 as Float).log(10.0), 1.0); | ||
| assert_approx_eq!((2.3 as Float).log(3.5), 0.664858, Float::LOG_APPROX); |
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.
This test here for f128 will fail because the precision is much higher, if you look at the original test, the expected value is much more precise than what you have written:
assert_approx_eq!(2.3f128.log(3.5), 0.66485771361478710036766645911922010272, TOL);When testing higher precision floats, you need much more precise expected values or the tests will fail, as they do now. In Miri, this is even more strict.
If you look at the source of f16 constants, they use much more digits after the decimal point than needed:
pub const PI: f16 = 3.14159265358979323846264338327950288_f16;So you should probably do that as well.
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.
Okay it makes sense . Thanks
|
Thank you for the final cleanup here. Until CI is fixed, |
|
Reminder, once the PR becomes ready for a review, use |
Will finish this as soon as possible . A bit busy these days. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0f27f23 to
507fb72
Compare
This comment has been minimized.
This comment has been minimized.
87f3042 to
2bb4a07
Compare
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in GUI tests. |
b6b949c to
eb0704d
Compare
This comment has been minimized.
This comment has been minimized.
tests/rustdoc-gui/notable-trait.goml
Outdated
| block { | ||
| call-function: ("check-notable-tooltip-position", {"x": |x|, "i_x": |i_x|}) | ||
| assert-count: ("//*[@class='tooltip popover']", 0) | ||
| assert-count: ("//*[@class='tooltip popover']", 1) |
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.
Please remove these changes.
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.
Done .
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #151087) made this pull request unmergeable. Please resolve the merge conflicts. |
eb0704d to
0a95979
Compare
This comment has been minimized.
This comment has been minimized.
441dce3 to
be39e88
Compare
|
@tgross35 made all the suggested changes and squashed the commits . Thanks |
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
958d860 to
a2ffe8b
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
a2ffe8b to
6ac8ff7
Compare
In this PR Float tests are deduplicated and are unified in floats/mod.rs, as discussed in #141726.
The moved float tests are:
-> test_powf
-> test_exp
-> test_exp2
-> test_ln
-> test_log_generic
-> test_log2
-> test_log10
-> test_asinh
-> test_acosh
-> test_atanh
-> test_gamma
-> test_ln_gamma
Closes: #141726
r? tgross35