Hi Nick,
On Fri, Nov 12, 2010 at 5:56 AM, Nick Alexander wrote:
> sage: ZZ([1, 2], base=3)
> 7
> sage: ZZ([1, 2], base=3).digits(2)
> [1, 1, 1]
>
> My opinion is that this is short and already well supported, and much
> more general than the special function OP suggests.
Base conversion is an im
On Nov 11, 11:39 am, Eviatar wrote:
> Yes, but can you go directly from base 2 to base 4, for example? I
> guess this would work, ZZ(23,base=2).str(base=4), but it's not very
> convenient.
sage: ZZ([1, 2], base=3)
7
sage: ZZ([1, 2], base=3).digits(2)
[1, 1, 1]
My opinion is that this is short
Yes, but can you go directly from base 2 to base 4, for example? I
guess this would work, ZZ(23,base=2).str(base=4), but it's not very
convenient.
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@google
On Nov 11, 10:13 am, Eviatar wrote:
> Thank you,
>
> I wasn't aware of that functionality. However, I think my function is
> more convenient since you can directly convert bases, instead of using
> base 10 as an intermediary step.
sage: ZZ(15).digits(2)
[1, 1, 1, 1]
sage: ZZ(15).digits(3)
[0, 2
Thank you,
I wasn't aware of that functionality. However, I think my function is
more convenient since you can directly convert bases, instead of using
base 10 as an intermediary step.
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an