Author scoder
Recipients mark.dickinson, pitrou, scoder, serhiy.storchaka
Date 2014-09-26.07:52:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411717951.94.0.775815371352.issue22501@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-09-26 07:52:32scodersetrecipients: + scoder, mark.dickinson, pitrou, serhiy.storchaka
2014-09-26 07:52:31scodersetmessageid: <1411717951.94.0.775815371352.issue22501@psf.upfronthosting.co.za>
2014-09-26 07:52:31scoderlinkissue22501 messages
2014-09-26 07:52:31scodercreate