On Dec 30, 2007 9:11 AM, David Joyner <[EMAIL PROTECTED]> wrote:
>
> Hi:
>
> sage: P = plot(e^(ln(2)*x),-1,1)
>
> works fine (note: e^(ln(2)*x) = 2^x) but
>
> sage: P = plot(2^x,-1,1)
> WARNING: When plotting, failed to evaluate function at 201 points.
> Last error message: 'exponent (=1.0) must be an integer.
> Coerce your numbers to real or complex numbers first.'
> ---------------------------------------------------------------------------
> <type 'exceptions.IndexError'> Traceback (most recent call last)
> ...
>
> returns an error.
>
> Seems like a bug. Should I create a track ticket for this?
Yes, that is *definitely* a bug:
http://modular.math.washington.edu:9002/sage_trac/ticket/1653
By the way, this works as a temporary workaround:
sage: show(plot(2.0^x,-1,1))
Perhaps the bug report would be clearer if it just pointed
out that this goes boom:
sage: 2^float(3.1)
---------------------------------------------------------------------------
<type 'exceptions.TypeError'> Traceback (most recent call last)
/Users/was/<ipython console> in <module>()
/Users/was/integer.pyx in sage.rings.integer.Integer.__pow__()
<type 'exceptions.TypeError'>: exponent (=3.1) must be an integer.
Coerce your numbers to real or complex numbers first.
Note:
sage: int(2)^float(3.1)
8.574187700290345
sage: (2/1)^float(3.1)
8.574187700290345
William
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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/
-~----------~----~----~----~------~----~------~--~---