Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/libsim/isum.sim
There is 1 other file named isum.sim in the archive. Click here to see a list.
OPTIONS(/E/C/-Q/-A/-I/-D);
COMMENT Procedure ISUM calculates the sum of the integer array IA
IA[1] + ... + IA[N].
;
INTEGER PROCEDURE isum(ia,n);   ARRAY ia;   INTEGER n;
BEGIN   INTEGER i,s;

    OPTIONS(/A);   s:= ia[1];   ia[n]:= ia[n];   OPTIONS(/-A);
    FOR i:= 2 STEP 1 UNTIL n DO  s:= s + ia[i];

    isum:= s

END of isum;