Message227590
The attached patch adds fast paths for PyLong division by 1 and -1, as well as dividing 0 by something. This was found helpful for fractions normalisation, as the GCD that is divided by can often be |1|, but firing up the whole division machinery for this eats a lot of CPU cycles for nothing.
There are currently two test failures in test_long.py because dividing a huge number by 1 or -1 no longer raises an OverflowError. This is a behavioural change, but I find it acceptable. If others agree, I'll fix the tests and submit a new patch. |
|
Date |
User |
Action |
Args |
2014-09-26 07:52:32 | scoder | set | recipients:
+ scoder, mark.dickinson, pitrou, serhiy.storchaka |
2014-09-26 07:52:31 | scoder | set | messageid: <1411717951.94.0.775815371352.issue22501@psf.upfronthosting.co.za> |
2014-09-26 07:52:31 | scoder | link | issue22501 messages |
2014-09-26 07:52:31 | scoder | create | |
|