Thanks, Minh - the second option seems as though it would be more
useful.

Can also do it with

hex(operator.xor(0x2bd5427c, 0x65ef24ab))

-Alasdair

On Sep 24, 2:14 am, Minh Nguyen <[email protected]> wrote:
> Hi Alasdair,
>
> On Thu, Sep 23, 2010 at 11:40 PM, Alasdair <[email protected]> wrote:
> > Is there a more direct way?  In python, the operator ^ is supposed to
> > implement x-or on strings, but of course in Sage that operator is
> > recognized as an exponential, and so gives an error.
>
> Maybe fiddling with the preparser is not what you want. You could use
> the xor() function built into Python without toggling the preparsing:
>
> sage: from operator import xor
> sage: hex(xor(0x2bd5427c, 0x65ef24ab))
> '4e3a66d7'
>
> --
> Regards
> Minh Van Nguyen

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

Reply via email to