This debate has been going on for as long as computers have been in existence. Yes, there is a case to be made the odd roots of negative reals should return a negative real instead of the "principal" complex root. But that leads to more subtle problems in other places. If all of mathematica, maple and matlab do the "non-obvious thing" there must be a good reason for it! And as Mike said, you can always get the real root by inserting brackets.
John Cremona On May 14, 6:56 am, Robert Bradshaw <rober...@math.washington.edu> wrote: > On May 13, 2009, at 9:11 PM, Bill Page wrote: > > > > > On Wed, May 13, 2009 at 11:54 PM, Robert Bradshaw wrote: > > >> This is because the branch in which the positive real root is real is > >> taken. We're opting for continuity and consistency with complex > >> numbers. > > > If I wrote: > > > sage: ComplexField(53)(-2.0)^(1/3) > > 0.629960524947437 + 1.09112363597172*I > > > that looks ok to me, but > > > sage: RealField(53)(-2.0)^(1/3) > > 0.629960524947437 + 1.09112363597172*I > > > looks very strange. Could you explain the advantage? > > I can try :) > > sage: a > -2.00000000000000 > sage: a^(1/3) > # what should happen here? > > The real field automatically promotes to complex in many instances > (e.g. sqrt, or all other non-integral powers or negative numbers), so > that's why I don't find it too strange. Also, it provides continuity > in the exponent: > > sage: [(-2.0)^a for a in [0..1, step=1/10]] > > [1.00000000000000, > 1.01931713553736 + 0.331196214043796*I, > 0.929316490603148 + 0.675187952399881*I, > 0.723648529606410 + 0.996016752925812*I, > 0.407750368641006 + 1.25492659684357*I, > 8.65956056235493e-17 + 1.41421356237309*I, > -0.468382177707358 + 1.44153211743623*I, > -0.954859959434831 + 1.31425198474794*I, > -1.40858040033850 + 1.02339356496073*I, > -1.77473421303888 + 0.576646101394740*I, > -2.00000000000000] > > I would find it odd if every other value here were real. > > Note that we're not the only ones doing this: > > sage: mathematica("(-2.0)^(1/3)") > 0.6299605249474367 + 1.0911236359717214*I > sage: maple("(-2.0)^(1/3);") > .6299605250+1.091123636*I > sage: matlab("(-2.0)^(1/3);") > 0.6300 + 1.0911i > sage: pari("(-2.0)^(1/3);") > 0.629960524947437 + 1.09112363597172*I > > - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---