On Thu, May 14, 2009 at 4:59 AM, John Cremona wrote:
>
> 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.

Granted. Choose your poison.

> If all of mathematica, maple and matlab do the "non-obvious thing"
> there must be a good reason for it!

There is but I think these reasons do not necessarily apply to Sage.

>  And as Mike said, you can always get the
> real root by inserting brackets.
>

???

Consider the problem to define

  f(x) = x^(1/3)

so that it takes the real branch for x < 0.  The best I have been able
to come up with so far is:

sage: f = lambda x: RealField(53)(x).sign()*(RealField(53)(x).sign()*x)^(1/3)
sage: plot(f,(-2,2))

I think there should be a more obvious way.

Regards,
Bill Page.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to