> Hmmm I don't know if I like this. Well, I don't have any objections
> to such a method being available, but I prefer the name "binary" to
> have the current behaviour. It's more pythonic, like the hex function.

But there is no binary/bin function. I understand that __hex__ returns a 
string to obey Python conventions but binary() is our addition. Also, if you 
are after a binary representation of an integer in SAGE you probably want to 
do calculations with it, so a tuple/list/iterable of bits seems more natural 
to me.

> BTW for the list format, I would prefer the least significant bit to
> be listed first. This is more like the list() function for
> polynomials, if you think of an integer as a polynomial in 2:
>
> eleven = 1*2^0 + 1*2^1 + 0*2^2 + 1*2^3 = [1, 1, 0, 1]

I think when it comes to endianess we will have to agree to disagree. In the 
multivariate world and in all the we-do-some-stuff-to-bits crypto big 
endianess (MSB is left) wins over little endianess. But it seem to me SAGE 
tends towards little endianess alltogether so I will return it in little 
endian order.

Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to