Jump to content

Sum and product of an array: Difference between revisions

(Logo)
Line 245:
' + 0 a 5 reduce . \ 15
' * 1 a 5 reduce . \ 120
 
=={{header|Fortran}}==
In ISO Fortran 90 and later, use SUM intrinsic:
REAL, DIMENSION(1000) :: A = (/ (1.0/(i*i), i=1, 1000) /)
REAL :: RESULT
RESULT = SUM(A);
 
=={{header|Groovy}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.