Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @mdickinson for commit 32aee25 🤖 If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again. |
Sorry, something went wrong.
|
I've removed the fmod asserts from the code. They were somewhat obscure, and it's not necessary for correctness that the target value is an integer. The only possible issue with a non-integer intpart is one of false positives: if intpart is a large and negative double in the open interval (PY_TIME_T_MIN - 1, PY_TIME_T_MIN) then:
So the failure mode is benign. But in any case, intpart must be an integer (or possibly an infinity or nan), so the above can't happen. |
Sorry, something went wrong.
|
I think this is ready to merge. @gpshead Do you have bandwidth for a quick re-review? |
Sorry, something went wrong.
|
Thanks @mdickinson for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
|
Sorry, @mdickinson and @gpshead, I could not cleanly backport this to 3.10 due to a conflict. |
Sorry, something went wrong.
|
GH-102062 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
|
GH-102150 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
|
Thanks for fixing this old annoying compiler bug, @mdickinson! |
Sorry, something went wrong.
|
I added math.nextafter() and math.ulp() to Python 3.9 to help me to understand this issue :-) But then I failed to come up with a fix for this warning. |
Sorry, something went wrong.
|
math.nextafter and math.ulp are very good to have, regardless! So thank you for that. |
Sorry, something went wrong.
This PR fixes some compiler warnings in pytime.c, and at the same time fixes our out-of-range double-to-integer checks to properly avoid undefined behaviour.
It's hard to write strictly portable code for this kind of thing, but the new check should work under a set of (very) mild assumptions, that are highly unlikely to be violated on any actual platform that we care about:
Here's the underlying logic for the changes, for the record: