MathGroup Archive 1999

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

Search the Archive

Re: Q about using Round.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg20609] Re: Q about using Round.
  • From: Cheng Lee Lung <eeacheng at cityu.edu.hk>
  • Date: Thu, 4 Nov 1999 02:13:27 -0500
  • Organization: City University of Hong Kong
  • References: <7v3clp$607@smc.vnet.net> <7vfe0u$bcu$7@dragonfly.wolfram.com>
  • Sender: owner-wri-mathgroup at wolfram.com


Wen-Feng Hsiao wrote:

> OK! I am sorry. My post is not readable.
> About my question, Lichtblau has kindly answered it for me. It is because
> the Map procedure will map the function to all parts of an expression.
> Thus, after mapping, the Sqrt[Pi] would be equal to Round[Pi]^Round[1/2]
> => 3^0 =1.
>
> Wen-Feng
>
> In article <7v3clp$607 at smc.vnet.net>, d8442803 at student.nsysu.edu.tw
> says...
> > Hi,
> >
> >    The following procedures are an example of 'Round' in the Mathematica
> > help. It is strange that the round of square-root of pi is 1. It is
> > supposed to be 2. Why?
> >
> > Wen-Feng
> >
> > -=-=-=-
> > In[7]:=
> > NumericRound[x_] := MapAll[If[NumericQ[#], Round[#], #] &, x]
> > In[8]:=
> > NumericRound[Sqrt[Pi] + (E + a) x + (4.3 - 8.6i )x^3] // InputForm
> > Out[8]//InputForm=
> > 1 + (3 + a)*x + (4 - 9*i)*x^3
> >
> > (* When changing it into the following , I obtain the desired result.
> > Why? *)

Try N[Sqrt[Pi]].

LL




  • Prev by Date: Re: Re: list manipulation
  • Next by Date: TensorQ
  • Previous by thread: reading information from a *.bmp bitmap
  • Next by thread: TensorQ