Q about using Round.
- To: mathgroup at smc.vnet.net
- Subject: [mg20454] Q about using Round.
- From: d8442803 at student.nsysu.edu.tw (Wen-Feng Hsiao)
- Date: Tue, 26 Oct 1999 00:33:26 -0400
- Organization: MIS
- Sender: owner-wri-mathgroup at wolfram.com
Hi, The following procedures are an example of 'Round' in the Mathematica help. It is strange that the rounding of square-root of pi is 1. It is supposed to be 2, isn't it? Wen-Feng -=-=-=- In[6]:= NumericRound[x_] := MapAll[If[NumericQ[#], Round[#], #] &, x] In[7]:= \!\(NumericRound[\ at \[Pi] + \((\[ExponentialE] + a)\)\ x + \((4.3 - 8.6 \[ImaginaryI]\ )\) x\^3]\) Out[7]= \!\(1 + \((3 + a)\)\ x + \((4 - 9\ \[ImaginaryI])\)\ x\^3\) (* When changing it into the following , I obtain the desired result. Why? *) In[8]:= \!\(NumericRound[\((\ at \[Pi] + \((\[ExponentialE] + a)\)\ x + \((4.3 - 8.6 \[ImaginaryI]\ )\) x\^3)\) // N]\) Out[8]= \!\(2 + \((3 + a)\)\ x + \((4 - 9\ \[ImaginaryI])\)\ x\^3\)