MathGroup Archive 1998

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

Search the Archive

Re: Union[{0},{0.}] = {0,0.}?


Stephen P Luttrell wrote in message <6l2pnd$dsa at smc.vnet.net>...
>>Union[{0},{0.}] = {0,0.}.
>>
>>Why?
>>
>>I would like the above to return only {0}.
>
>Try this:
>
>Union[{0},{Chop[0.]}]
>


Stephen,

Here's a variant that let's us work from the outside

Chop[ Unevaluated[Union[{0},{0.}]] ]

{0}

Allan

------------------------------------------------------------- 
Allan Hayes
Training and Consulting
Leicester UK
http://www.haystack.demon.co.uk
hay at haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44(0)116 271 8642



  • Prev by Date: Re: Efficient way to merge lists--Programming help
  • Next by Date: Re: What am i missing?
  • Previous by thread: Re: Union[{0},{0.}] = {0,0.}?
  • Next by thread: IT and mathematics conference in Japan - August 1998