MathGroup Archive 2008

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

Search the Archive

Re: Identical elements

  • To: mathgroup at
  • Subject: [mg88409] Re: Identical elements
  • From: Szabolcs Horvát <szhorvat at>
  • Date: Mon, 5 May 2008 06:09:34 -0400 (EDT)
  • Organization: University of Bergen
  • References: <fvhe2h$3th$>

KFUPM wrote:
> Dear All
> I have a list  and i need to test whether all the elements in the list
> are identical or no. What is the efficient way to do that? The output
> should be true if all elements are the same and False otherwise. One
> line command is preferred if possible.

SameQ @@ list

But note that 0 and 0.0 are not identical (you may need Equal instead of 

  • Prev by Date: Re: Fit data with range
  • Next by Date: Re: Getting the size of the bounding box of a Graphics3D[]
  • Previous by thread: Re: Identical elements
  • Next by thread: Re: Identical elements