Re: Peculiar output from Union ?
- To: mathgroup at smc.vnet.net
- Subject: [mg108525] Re: Peculiar output from Union ?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sun, 21 Mar 2010 02:08:16 -0500 (EST)
On 3/20/10 at 2:46 AM, jackgold at umich.edu (Jack L Goldberg 1) wrote:
>Can anyone explain this:
>In[1]:= Union[ 1 < x < 2, 3 < x < 5 ]
>Out[1]= 5 < x
>??
>I am using a MacBook Pro, OS 10.6.2
The result you get using Trace to see what happens, i.e.,
In[2]:= Union[1 < x < 2, 3 < x < 5] // Trace
Out[2]= {HoldForm[Union[1 < x < 2, 3 < x < 5]],
HoldForm[1 < 2 < 3 < 5 < x],
HoldForm[5 < x]}
shows what is going on.
Perhaps you want something more like
In[3]:= IntervalUnion[Interval[{1, 2}], Interval[{3, 5}]]
Out[3]= Interval[{1,2},{3,5}]