Google
 

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

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

    rsum:= s

END of rsum;