---------- Forwarded message ----------
From: pong <[EMAIL PROTECTED]>
Date: Tue, Oct 28, 2008 at 9:42 PM
Subject: Re: Bug in ploting odd roots?
To: William Stein <[EMAIL PROTECTED]>


Hi William,

    I have a similar problem and found this old post. Is there a less
complicated solution by now?

    By the way, why the function RDF in capitol letters? Isn't it the
convention of SAGE that function names are in lower case?

    Also, looks like after a certain period of time, one can only
"reply to the author" instead of just "reply" in google, is that
right?

Thanks
Pong

On Oct 20 2007, 11:06 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> On 10/20/07, Nikos Apostolakis <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hello group,
>
> > even though
>
> > sage: (-8)^(1/3)
> > -2
>
> > when I try to plot x^(1/3) I get:
>
> > sage: plot(x^(1/3), -27, 27).show()
> > WARNING: When plotting, failed to evaluate function at 100 points.
> > Last error message: 'negative number cannot be raised to a
> >fractionalpower'
>
> > and the plot shown has only for positive x.  Is this a bug?
>
> The problem is that when you write (-8)^(1/3) maxima is doing
> the simplification with -8 and integer.  When you do the plot,
> what happens is Python floats are substituted in and raised
> to thepower1/3, which causes the problem.  Python has this
> rule regarding powers:
>
> sage: float(-1)**float(0.333)
> ---------------------------------------------------------------------------
> <type 'exceptions.ValueError'>            Traceback (most recent call last)
>
> /home/was/<ipython console> in <module>()
>
> <type 'exceptions.ValueError'>: negative number cannot be raised to 
> afractionalpower
>
> Here is a ridiculously complicated work-around (all on one line):
>
> sage: plot(lambda x:  (-1 if x < 0 else 1)*abs(RDF(x))^(1/3), -27,
> 27).show(ymax=3)


-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to