Anonymous user
Averages/Arithmetic mean: Difference between revisions
m
→{{header|Fortran}}
Line 129:
=={{header|Fortran}}==
In ISO Fortran 90 or later, use the SUM intrinsic, the SIZE intrinsic and the MAX intrinsic (to avoid divide by zero):
REAL, TARGET, DIMENSION(100) :: A = (/ (i, i=1, 100) /)
REAL, DIMENSION(5,20) :: B = RESHAPE( A, (/ 5,20 /) )
REAL, POINTER, DIMENSION(:) :: P => A(2:1) ! pointer to zero-length array
|