Re: [sage-devel] Re: Base Conversion

2010-11-12 Thread Minh Nguyen
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

[sage-devel] Re: Base Conversion

2010-11-11 Thread Nick Alexander
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

[sage-devel] Re: Base Conversion

2010-11-11 Thread Eviatar
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

[sage-devel] Re: Base Conversion

2010-11-11 Thread Nick Alexander
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

[sage-devel] Re: Base Conversion

2010-11-11 Thread Eviatar
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