Oleksandr Kazymyrov <vrona.aka.ham...@gmail.com> writes:
> In manual "ZZ ?" you can find:
>
> As an inverse to "digits()", lists of digits are accepted, provided
>        that you give a base. The lists are interpreted in little-endian
>        order, so that entry "i" of the list is the coefficient of
>        "base^i":
>     
>           sage: Z([3, 7], 10)
>           73
>           sage: Z([3, 7], 9)
>           66
>           sage: Z([], 10)
>           0
>
> But for base more than 2^64 it doesn't work. It looks stupid, because you can
> call "digits(2^64)", but not an inverse function:
> sage: a=ZZ(randint(0,2^128-1)).digits(2^64)
> sage: a
> [1154963902035838039, 8176620537326016718]
> sage: ZZ(a,2^64)
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (1348, 0))
>
> ---------------------------------------------------------------------------
> OverflowError                             Traceback (most recent call last)
> ....
> OverflowError: long int too large to convert

Thank you for the report! This is now lucky ticket #13000 -
http://trac.sagemath.org/sage_trac/ticket/13000

-Keshav

----
Join us in #sagemath on irc.freenode.net !

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to