It is due to the fact that ^ has a higher precedence than - in Python. n(-1^(1/3)) is the same as n((-1^(1/3))). --Mike
On Jan 23, 2008 5:04 PM, Ted Kosan <[EMAIL PROTECTED]> wrote: > > Does anyone have any thoughts on why the following 2 code samples give > different results?: > > #SAGE Version 2.10, Release Date: 2008-01-18 > > > sage: n(-1^(1/3)) > -1.00000000000000 > > sage: n((-1)^(1/3)) > 0.500000000000000 + 0.866025403784439*I > > The only difference between them is that parentheses have been placed around > -1. > > Thanks, > > Ted > > > > --~--~---------~--~----~------------~-------~--~----~ 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://www.sagemath.org -~----------~----~----~----~------~----~------~--~---