To avoid massive confusion the __xor__ operator is not defined for SAGE
integers.  Instead use the _xor function, which will be very fast:

sage: n = 5; m = 17
sage: n._xor(m)
20




On 6/8/07, Andrew Budker <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I'm getting the following error when calling the xor operator from
> a .py file:
> because sage interprets ^ as exponentiation, i imported the xor
> function from operator.
> whats even stranger, is that the xor seems to work from the command
> line just fine.
>
>
> --> 178             t0 = self.ideaMultiply(roundSubKeys[4],
> xor(temp[0],temp[2]))
>
>
> /home/abudker/Desktop/199/sage-2.5.0.2/devel/sage-main/sage/crypto/
> element.pyx in element.Element.__xor__()
>
> <type 'exceptions.RuntimeError'>: Use ** for exponentiation, not '^',
> which means xor
>
> thanks,
>
> -Andrew Budker
>
>
> >
>


-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://www.williamstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to