Re: Q: Union and precision.
- To: mathgroup at smc.vnet.net
- Subject: [mg8567] Re: Q: Union and precision.
- From: Red <red at nym.alias.net>
- Date: Sat, 6 Sep 1997 23:16:29 -0400
- Organization: mail2news@nym.alias.net
- Sender: owner-wri-mathgroup at wolfram.com
-----BEGIN PGP SIGNED MESSAGE----- Gadi Oron <oron at manet.pmmh.espci.fr> wrote in <5uleeq$cp6 at smc.vnet.net>: >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} (* !!! *) Do this: Union[ {a,b}, SameTest->Equal] Equal is == -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNBDgNLcaab4ltFhVAQFkSgP+OHSssXcpHuM5anIKlB5lYzG2NOmgAzKE v6FVU4w7+GQ39yDptz58QMkReF0+0vzGQfhIIAL6xkxd3CtGgVZaOgpTCFuovDgL DchyHLYGF5Ac/z6+dP0hQEf4G5VXIELieEE8Tb+pyPK/ubiGHrHpMyQXy38Mn7Tq cL3HT0z4phk= =sFcP -----END PGP SIGNATURE-----