PyWart: Language missing maximum constant of numeric types!

MRAB python at mrabarnett.plus.com
Sat Feb 25 01:37:58 CET 2012


On 24/02/2012 23:16, Michael Torrie wrote:
> On 02/24/2012 09:59 AM, Mark Lawrence wrote:
>>  The C integer bit doesn't matter since e.g.
>>   >>>
>>  a=10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
>>   >>>  a
>>  10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000L
>>
>>  And no, I'm not going to calculate how much memory I'd need to store a
>>  string that's this long :)
>
> Sure but that doesn't answer the question posed.  How does Rick plan to
> represent an infinite integer? Obviously you've shown that with an
> infinite amount of memory we could do it quite easily.  But baring that,
> how does Rick suggest we should represent an infinite integer?

We already have arbitrarily long ints, so there could be a special
infinite int singleton (actually, 2 of them, one positive, the other
negative).



More information about the Python-list mailing list