[New-bugs-announce] [issue10629] Arbitrary precision

Bill McEachen report at bugs.python.org
Sun Dec 5 09:43:16 CET 2010


New submission from Bill McEachen <billymac00 at excite.com>:

from this link [http://en.wikipedia.org/wiki/PARI/GP#Usage_examples], I wanted to contrast arbitrary precision with the other pgm I use, Pari/GP.  I tried the xample there which was:
123456! + 0.
Now, behavior seems the same without the "+0." for both.  However, while Pari returns the answer shown on link quickly, Python after a delay returned an error, related to float conversion.  Here is the progression from a smaller number to the problem:
>>> math.factorial(12) +0.
479001600.0
>>> math.factorial(123) +0.
1.214630436702533e+205
>>> math.factorial(1234) +0.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: long int too large to convert to float
>>>

----------
components: Regular Expressions
messages: 123414
nosy: billymac00
priority: normal
severity: normal
status: open
title: Arbitrary precision
type: behavior
versions: Python 2.7

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


More information about the New-bugs-announce mailing list