GeezerVison is showing github.com — Remove m_remainder() by skirpichev · Pull Request #158826 · python/cpython
Conversation
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
picnixz
commented
Oct 5, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Can we have an issue about replacing our remainder with C math remainder?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
replacing our remainder with C math remainder?
It looks like it's already completely broken for Window$ (Tier 1) and Android (Tier 3). (In #101679 I did similar attempt for lgamma/tgamma. IIRIC, tests were broken on Win/Mac.)
So, it's not ready yet. Though, maybe it's a good idea to document why we need this implementation, with a list of broken platforms... For m_log*() functions things now might be better.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Failures:
- For buildbot/aarch64 Android PR (same for amd64):
FAIL: testRemainder (test.test_math.MathTests.testRemainder)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/data/user/0/org.python.testbed/files/python/lib/python3.16/test/test_math.py", line 1858, in testRemainder
validate_spec(x, y, actual)
~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/data/user/0/org.python.testbed/files/python/lib/python3.16/test/test_math.py", line 1770, in validate_spec
self.assertEqual(n, int(n))
~~~~~~~~~~~~~~~~^^^^^^^^^^^
AssertionError: Fraction(-1, 25) != 0
- On Windows, e.g. buildbot/AMD64 Windows10 PR:
FAIL: testRemainder (test.test_math.MathTests.testRemainder)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\buildarea\pull_request.bolen-windows10\build\Lib\test\test_math.py", line 1858, in testRemainder
validate_spec(x, y, actual)
~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "D:\buildarea\pull_request.bolen-windows10\build\Lib\test\test_math.py", line 1767, in validate_spec
self.assertLessEqual(abs(fr), abs(fy/2))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
AssertionError: Fraction(3, 50600563326827654588123836679729326762389162441035529589225339506857584891998836722990095925359281123796769466079202977847452184346448369216753349985184627480379356069141590341116726935523304085309941919618186267140501870856173174654525838912289889085202514128089692388083353653807625633046581877161501565826926935273373696) not less than or equal to Fraction(23, 404804506614621236704990693437834614099113299528284236713802716054860679135990693783920767402874248990374155728633623822779617474771586953734026799881477019843034848553132722728933815484186432682479535356945490137124014966849385397236206711298319112681620113024717539104666829230461005064372655017292012526615415482186989568)
or on x32:
FAIL: testRemainder (test.test_math.MathTests.testRemainder)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\a\cpython\cpython\Lib\test\test_math.py", line 1858, in testRemainder
validate_spec(x, y, actual)
~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "D:\a\cpython\cpython\Lib\test\test_math.py", line 1767, in validate_spec
self.assertLessEqual(abs(fr), abs(fy/2))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
AssertionError: Fraction(13, 202402253307310618352495346718917307049556649764142118356901358027430339567995346891960383701437124495187077864316811911389808737385793476867013399940738509921517424276566361364466907742093216341239767678472745068562007483424692698618103355649159556340810056512358769552333414615230502532186327508646006263307707741093494784) not less than or equal to Fraction(25, 404804506614621236704990693437834614099113299528284236713802716054860679135990693783920767402874248990374155728633623822779617474771586953734026799881477019843034848553132722728933815484186432682479535356945490137124014966849385397236206711298319112681620113024717539104666829230461005064372655017292012526615415482186989568)
BTW, I think it will be a good idea to modernize math tests (including above example) with using subTest method or subTests decorator.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|