[IronPython] IronPython and Big Numbers

Dino Viehland dinov at exchange.microsoft.com
Fri Mar 9 20:21:46 CET 2007


Thanks for reporting this.  This is actually slightly different than the bug described in the differences doc.  There we're actually just preventing you from an inevitable OOM and here we're failing to do the power which should succeed.

This seems to work as long as the left hand side of the power operation is a BigInt:

>>> x = 10 ** 10
>>> x ** 10
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000L
>>> 10 ** x
Number too big


We probably need to support reverse-power on IntOps.  I've opened a work item for this (#8795, http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=8795).  Please feel free to vote on it to help us prioritize the bugs.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
Sent: Friday, March 09, 2007 9:41 AM
To: Discussion of IronPython
Subject: Re: [IronPython] IronPython and Big Numbers

Aaron Leiby wrote:
> http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&title=Differences
>
> "IronPython raises a ValueError for very large exponents (for example, 10 **
> 735293857239475) while CPython hangs trying to compute the number.  We
> probably won't fix this one."
>

:-)
> ----- Original Message -----
> From: "Michael Foord" <fuzzyman at voidspace.org.uk>
> To: "Discussion of IronPython" <users at lists.ironpython.com>
> Sent: Friday, March 09, 2007 4:30 AM
> Subject: [IronPython] IronPython and Big Numbers
>
>
>> IronPython doesn't seem to like *very* big integers :
>>
>> IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42
>> Copyright (c) Microsoft Corporation. All rights reserved.
>>
>>>>> 10 ** 10 ** 10
>>>>>
>> Traceback (most recent call last):
>>  File , line 0, in <stdin>##78
>> ValueError: number too big
>>
>> This may be fixed in 1.1, or it may not be important. :-)
>>
>> Michael Foord
>> http://www.voidspace.org.uk/ironpython/index.shtml
>>
>> _______________________________________________
>> users mailing list
>> users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>

_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list