MathGroup Archive 2010

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

Search the Archive

Re: Peculiar output from Union ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108522] Re: Peculiar output from Union ?
  • From: "Carl K. Woll" <carlw at wolfram.com>
  • Date: Sun, 21 Mar 2010 02:07:43 -0500 (EST)

On 3/20/2010 3:46 AM, Jack L Goldberg 1 wrote:
> Hi Folks,
>
> Can anyone explain this:
>
> In[1]:= Union[  1<  x<  2, 3<  x<  5  ]
>
> Out[1]= 5<  x
>
> ??
>
>    
The FullForm is:

Union[ Less[1, x, 2], Less[3, x, 5] ]

which evaluates to:

Less[1, 2, 3, 5, x]

because that's the way Union works for any head. Usually the head is 
List, not Less. From the help:

The Subscript[list, i] must have the same head, but it need not be List.

The above Less expression evaluates to Less[5, x]

Carl Woll
Wolfram Research

> I am using a MacBook Pro, OS 10.6.2
>
> Thanks,
>
> Jack
>
>    


  • Prev by Date: Re: Peculiar output from Union ?
  • Next by Date: Re: Need larger window for Manipulate Slider Control
  • Previous by thread: Re: Peculiar output from Union ?
  • Next by thread: Re: Peculiar output from Union ?