-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
failing doctest on Apple M1
: corrected the test case by sorting the result
#36852
failing doctest on Apple M1
: corrected the test case by sorting the result
#36852
Conversation
failing doctest on Apple M1
: corrected the test case by sorting the result
Thanks, and welcome to the weird world of floating point computations. 😃 As you can see in the failing CI run you get the doctest error there. I think the reason is that the real parts of the roots you are sorting are not exactly equal, and so your lexicographic ordering does not work as you wanted. Yes, in principle you could do rounding in your But in this particular case it would suffice to sort on the imaginary part only (as they are quite different for the 3 roots),
|
c8750a8
to
a447432
Compare
I rounded off the values in the Complex Double Field to correct the test cases. |
ok, this works on Apple M1 |
Documentation preview for this PR (built with commit 4c46019; changes) is ready! 🎉 |
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.
looks good now.
I have added
rts = sorted(rts, key=lambda x: (x.real(), x.imag()))
after
rts = f.roots(ring=fld_out, multiplicities=False)
inI have sorted the rts; first based on the real part of the complex number and then based on the complex part.
I have also updated the test result by sorting them aswell.
This ensures that the output matches the test results, resulting in a passing test.
Fixes #36850
📝 Checklist