MathGroup Archive 2001

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

Search the Archive

Re: Greatest element in list


In a message dated 2001/8/23 2:25:18 AM, 
oliver.friedrich at tz-mikroelektronik.de writes:

>what's the best way to get the position of the greatest number in list
>of
>reals? I've tried
>
>Position[#,Max[#]]&list
>
>but surprisingly, it doesn't work all the time, sometimes it returns an
>empty list. How is that, because a theorem says that a non empty set of
>real
>numbers must have at least one biggest element. So Max[#] can't be empty.
>

data = Table[Random[], {5}];

You left off the argument's brackets.

Position[#, Max[#]]& [data]

{{4}}

Can you provide a specific example wherein this does not work?


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: Greatest element in list
  • Next by Date: RE: combining Log[] terms
  • Previous by thread: Re: Greatest element in list
  • Next by thread: Re: Greatest element in list