For posterity, the subtle point that Stein made is that instead of
substituting the integer 5, he used the the float 5.0 to get the
result.
On Apr 15, 11:26 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 15, 2008 at 11:22 AM, Reckoner <[EMAIL PROTECTED]> wrote:
>
> > Suppose I have something like:
>
> > sage: x,y,z=var('x y z')
> > sage: eq = cos(x)*sin(y)*tan(x)
>
> > and I want to substitute a value for x, say, x=5. Then,
> > I would have
>
> > eq = cos(5)*sin(y)*tan(5)
>
> > which is what I get when I do .substitute() in sage. However, I want
> > this partially numerically evaluated to obtain
>
> > eq = 0.28366*sin(y)*(-3.38051)
>
> > How can I do this?
>
> sage: x,y,z=var('x y z')
> sage: eq = cos(x)*sin(y)*tan(x)
> sage: eq(x=5.0)
> -0.958924274663139*sin(y)
--~--~---------~--~----~------------~-------~--~----~
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---