MathGroup Archive 1999

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

Search the Archive

Re: question

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

Alexandru Tintea <alext at> wrote in message
news:831sjn$fj2 at
> In Mathematica Version 2.2. I can't write_and_evaluate Cos[2]*Sin[3]
> 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
> 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 -

When you want Mathematica to convert to numbers wherever possible use N. For
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