Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: How use the Union function (MMA v.2,2 on PC )?

  • To: mathgroup at
  • Subject: [mg975] Re: [mg883] How use the Union function (MMA v.2,2 on PC )?
  • From: Allan Hayes <hay at>
  • Date: Thu, 4 May 1995 05:54:33 -0400

>From: Boguslaw Ptaszynski <ptaszyns at>
>Subject: [mg883] How use the Union function (MMA v.2,2 on PC )?

>Dear Mathgroup
>I have wanted to use the Union function to remove repeated elements
>in the following problem :
>Clear[pe, pierw, llk, x, i, imax, k, u, fun];
>pe=100; fun=Tan[x]+(2/pe)*x;
>pierw=Table[FindRoot[fun==0, {x, k}], {k, 3, 10, 0.5}];
>imax=Length[pierw]; u=Flatten[pierw]; llk=Table[N[u[[i,2]],7],  
>but I was unable to get it. Why ?

The different starting points give slightly different answers.
We need to make Union less discriminating, for example.
(I do not show my evaluation of your code)

	Union[llk, SameTest -> ((Abs[#1-#2] <10^-10)&)]
	{3.080069, 6.160591, 9.242001}
Allan Hayes
hay at

  • Prev by Date: Re: Challenge!
  • Next by Date: Re: Options and FilterOptions
  • Previous by thread: Help me derive this function
  • Next by thread: Set Theory on Mathematica