New submission from Nick Coghlan:

I believe this is mostly a curiousity (since actually calculating a factorial 
this big would take an interminable amount of time), but math.factorial can be 
provoked into throwing OverflowError by a large enough input:

>>> math.factorial(10**19)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C long

>>> math.factorial(1e19)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C long

----------
messages: 210448
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: math.factorial may throw OverflowError

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20539>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to