MathGroup Archive 1997

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

Search the Archive

Q: Union and precision.


Hello again,

How can I force Union to consider numbers equal in the current 
precision as equal? Explanation:

In:= 	a=SetPrecision[1.234567,2]
Out:= 	1.2

In:= 	b=SetPrecision[1.234561,2]  (* Notice difference *)
Out:= 	1.2

In:= 	a==b
Out:=	True

In:=	Union[{a,b}]
Out:=	{1.2,1.2} (* !!! *)

How does Union evaluates equalities? How can I force it to do it the right
way??
  
Thanx.
/\/\/\/\/\/\/\/\/\/\/\/>> Gadi ORON <<\/\/\/\/\/\/\/\/\/\/\/\/\
| EMAIL :  oron at pmmh.espci.fr   ::::     oron at clipper.ens.fr  |
| Homepage : http://pmmh.espci.fr/~oron/personal.html         |
| fido : 2:325/302.8                                          |
| 		  Soyez braves - be brave.                    |
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/




  • Prev by Date: Re: lists of pairs
  • Next by Date: Re: Hyperlinks in Mathematica 3.0 notebooks.
  • Previous by thread: Q??: Solve::"eqf": "False is not a well-formed equation
  • Next by thread: RE: Q: Union and precision.