Sum and product of an array: Difference between revisions

Content added Content deleted
(Logo)
Line 245: Line 245:
' + 0 a 5 reduce . \ 15
' + 0 a 5 reduce . \ 15
' * 1 a 5 reduce . \ 120
' * 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}}==
=={{header|Groovy}}==