


![[top]](top.gif)
Synopsis:
If the largest element occurs more than once, then the first occurrence is used. If x has length 0 an error results.
See also:
Code:
-- ../../../Macaulay2/m2/lists.m2:22-28
maxPosition BasicList := ZZ => x -> (
if # x === 0 then error "expected a nonempty list"
else (
m := x#0;
pos := 0;
scan(1 .. # x-1, i -> if x#i>m then (m=x#i;pos=i));
pos))



![[top]](top.gif)