Logo

Programming-Idioms

History of Idiom 54 > diff from v53 to v54

Edit summary for version 54 by Der Teufel:
New Ada implementation by user [Der Teufel]

Version 53

2021-06-07, 22:31:26

Version 54

2021-08-07, 14:21:12

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Variables
s,x
Variables
s,x
Code
for E of x loop
   S := S + E;
end loop;
Comments bubble
x is an array.
S is initialized to be 0.