This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients gladman, mark.dickinson, pitrou, scoder, serhiy.storchaka, wolma
Date 2014-09-27.13:39:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485407.hENKg6x4Dx@raxxla>
In-reply-to <>
> Why are the two Py_ABS() calls at the end needed when we start off the
> algorithm with long_abs()?

Because long_abs()'s are omitted for small enough numbers (common case). So we 
avoid a copying for negative numbers or int subclasses.

> I guess that's why you added the pure Euclidean implementation

Euclidean algorithm is required step at the end of Lehmer algorithm.

> It's 4% faster than the Euclidean code for the fractions benchmark
> when using 30 bit digits, but (surprisingly enough) about the same speed
> with 15 bit digits.

May be because Lehmer code uses 64-bit computation for 30-bit digits, and 
Euclidean code always uses 32-bit computation.

> The difference for big numbers is substantial though:

1000-bit integers are big, but can be encountered in real word (e.g. in 
cryptography). So may be there is need in Lehmer algorithm.
Date User Action Args
2014-09-27 13:39:24serhiy.storchakasetrecipients: + serhiy.storchaka, mark.dickinson, pitrou, scoder, wolma, gladman
2014-09-27 13:39:24serhiy.storchakalinkissue22486 messages
2014-09-27 13:39:24serhiy.storchakacreate