MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21191] Re: question
  • From: "David Bailey" <dave-bailey at freeuk.com>
  • Date: Fri, 17 Dec 1999 01:24:00 -0500 (EST)
  • References: <831sjn$fj2@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Alexandru Tintea <alext at pluto.qteam.ici.ro> wrote in message
news:831sjn$fj2 at smc.vnet.net...
> In Mathematica Version 2.2. I can't write_and_evaluate Cos[2]*Sin[3]
because
> I receive a simple result: Cos[2]*Sin[3]
> If I write Cos[0.2]*Sin[3.3] I receive a numeric result: 0.05756;
> If I write Evaluate[Cos[0.2]]*Evaluate[Sin[3.3]] I receive a numeric
result:
> 0.05756;
> If I write Evaluate[Cos[2]]*Evaluate[Sin[3]] I receive a literal result:
> Evaluate[Cos[2]]*Evaluate[Sin[3]]
> I set the path in the "init.m" file and I receive the same answers.
> What can I do?
> Thank You!
>

Mathematica never converts an exact quantity, such as Sin[2], to an inexact
numerical value unless you explicitly request it. This makes sense, you
would not want the series expansion to Sin[x]  (say) to look like:

x - 0.16666666666666666*x^3 +  0.008333333333333333*x^5 -
0.0001984126984126984*x^7

When you want Mathematica to convert to numbers wherever possible use N. For
example:
N[Cos[2]] (or, equivalently, Cos[2]//N )  will give you what you want.

The Evaluate function performs a quite different operation, although its
name does look promising!

David Bailey
Salford Software



  • Prev by Date: Re: Calling a c++ dll with Mathlink
  • Next by Date: Re: DiracDelta Function question
  • Previous by thread: Re: question
  • Next by thread: (Newbie) Applying colors to surface plots