Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2010

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

Search the Archive

Re: Why Return[] does not work?

  • To: mathgroup at
  • Subject: [mg109502] Re: Why Return[] does not work?
  • From: image_doctor <eep1mp at>
  • Date: Sat, 1 May 2010 06:51:25 -0400 (EDT)
  • References: <hr6ihp$2f8$>

> 2) is there better way to implement intersection check?

You could try this relatively elegant solution ....

IntersectQ[a_, a_] := True
IntersectQ[a_, b_] := False

With the following  timing results.

r1 = RandomInteger[{1,5},{n}];
r2 = RandomInteger[{1,5},{n}];

Out[55]= {0.,True}
Out[56]= {0.,False}
Out[57]= {0.,True}

  • Next by Date: Re: How to disable Integrate[] ?
  • Next by thread: Re: Why Return[] does not work?