Skip to content

Instantly share code, notes, and snippets.

@fracek
Created August 6, 2014 10:10
Show Gist options
  • Save fracek/ebdbed3247bbad7dc97f to your computer and use it in GitHub Desktop.
Save fracek/ebdbed3247bbad7dc97f to your computer and use it in GitHub Desktop.
proc (1) = minpr(x);
local d,m,i,minx;
i = 1;
m = 1;
d = x[1];
do while i <= rows(x);
if x[i] < d;
d = x[i];
endif;
i = i+1;
endo;
i = 2;
do while i <= rows(x);
if d == x[i];
m = i;
goto stops;
endif;
i = i + 1;
endo;
stops:
retp(m);
endp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment