RE: Union[{Pi, N[Pi]}]

*To*: mathgroup at smc.vnet.net*Subject*: [mg12750] RE: [mg12739] Union[{Pi, N[Pi]}]*From*: Ersek_Ted%PAX1A at mr.nawcad.navy.mil*Date*: Wed, 10 Jun 1998 03:04:12 -0400*Sender*: owner-wri-mathgroup at wolfram.com

Mark McClure wrote: | | |We've seen the Union[{0,0.}] discussion. Here's a little variation |which seems a little trickier. | |In[8]:= |N[{3.141592, Pi}, 3] // Union | |Out[8]= |{3.14,3.14} | | In[1]:= N[{3.141592, Pi}, 3] //InputForm Out[1]//InputForm= {3.141592, 3.141592653589793} You probably expected they would both get rounded to 3 decimal places. N[expr, 3] gives the same result as N[expr]. At least that's what I see from the lines below. In[2]:= x1=N[Pi,3]; x2=N[Pi]; In[3]:= InputForm[x1] Out[3]//InputForm= 3.141592653589793 In[4]:= InputForm[x2] Out[4]//InputForm= 3.141592653589793 In[5]:= Precision/@{x1,x2} Out[5]= {16,16} This also explains the other results you reported. _________________ Ted Ersek