[issue8692] Use divide-and-conquer for faster factorials

Daniel Stutzbach report at bugs.python.org
Wed May 12 20:37:50 CEST 2010


Daniel Stutzbach <daniel at stutzbachenterprises.com> added the comment:

On Wed, May 12, 2010 at 12:59 PM, Mark Dickinson <report at bugs.python.org> wrote:
> (4) And please do restore the PyLong_FromDouble line in the main routine, rather than using a C double-to-long cast.  The direct conversion again leads to undefined behaviour for large doubles (cf. C99 6.3.1.4,p2).

I was planning to add a "if (dx > (double) LONG_MAX)" check.  Would
that be sufficient?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8692>
_______________________________________


More information about the Python-bugs-list mailing list