Skip to content

Commit b1c481d

Browse files
committed
stat_dev: modifs following comments
1 parent e64657c commit b1c481d

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/stdlib_experimental_stat.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,38 @@
66

77
## MEAN - mean of array elements
88

9-
### Description
9+
### Description:
1010

11-
Returns the mean of all the elements of *ARRAY*, or of the elements of *ARRAY* along dimension *DIM*.
11+
Returns the mean of all the elements of *array*, or of the elements of *array* along dimension *dim*.
1212

13-
### Syntax
13+
### Syntax:
1414

15-
RESULT = mean(*ARRAY*)
15+
RESULT = mean(*array*)
1616

17-
RESULT = mean(*ARRAY*, *DIM*)
17+
RESULT = mean(*array*, *dim*)
1818

19-
### Arguments
19+
### Arguments:
2020

21-
*ARRAY*: Must be an array of type INTEGER, or REAL.
21+
*array*: Shall be an array of type INTEGER, or REAL.
2222

23-
*DIM* (optional): Must be a scalar of type INTEGER with a value in the range from 1 to n, where n equals the rank of *ARRAY*.
23+
*dim* (optional): Shall be a scalar of type INTEGER with a value in the range from 1 to n, where n is the rank of *array*.
2424

25-
### Return value
25+
### Return value:
2626

27-
If *ARRAY* is of type REAL, the result is of the same type as ARRAY.
28-
If *ARRAY* is of type INTEGER, the result is of type as *double precision*.
27+
If *array* is of type REAL, the result is of the same type as array.
28+
If *array* is of type INTEGER, the result is of type as *double precision*.
2929

30-
If *DIM* is absent, a scalar with the mean of all elements in *ARRAY* is returned. Otherwise, an array of rank n-1, where n equals the rank of *ARRAY*, and a shape similar to that of *ARRAY* with dimension *DIM* dropped is returned.
30+
If *dim* is absent, a scalar with the mean of all elements in *array* is returned. Otherwise, an array of rank n-1, where n equals the rank of *array*, and a shape similar to that of *array* with dimension *dim* dropped is returned.
3131

32-
### Example
32+
### Example:
3333

3434
```fortran
3535
program test
3636
use stdlib_experimental_stat, only: mean
3737
implicit none
38-
real :: x(1:6) = (/ 1., 2., 3., 4., 5., 6. /)
38+
real :: x(1:6) = [ 1., 2., 3., 4., 5., 6. ]
3939
print *, mean(x) !returns 21.
40-
print *, mean( reshape(x, (/ 2, 3 /) )) !returns 21.
41-
print *, mean( reshape(x, (/ 2, 3 /) ), 1) !returns (/ 3., 7., 11. /)
40+
print *, mean( reshape(x, [ 2, 3 ] )) !returns 21.
41+
print *, mean( reshape(x, [ 2, 3 ] ), 1) !returns [ 3., 7., 11. ]
4242
end program
4343
```

0 commit comments

Comments
 (0)