Skip to content

Commit de2c419

Browse files
jvdp1ivan-pi
andauthored
Apply suggestions from code review
Co-authored-by: Ivan Pribec <ivan.pribec@gmail.com>
1 parent 3eb4e4a commit de2c419

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

doc/specs/stdlib_stats.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ Experimental
188188

189189
Returns the median of all the elements of `array`, or of the elements of `array` along dimension `dim` if provided, and if the corresponding element in `mask` is `true`.
190190

191-
After that the elements are sorted in an increasing order, e.g. `array_sorted =
192-
sort(array)`, the median of the elements of `array` is defined as the "middle"
193-
element. If `n = size(array)` is an even number, the median is:
191+
The median of the elements of `array` is defined as the "middle"
192+
element, after that the elements are sorted in an increasing order, e.g. `array_sorted =
193+
sort(array)`. If `n = size(array)` is an even number, the median is:
194194

195195
```
196196
median(array) = array_sorted( floor( (n + 1) / 2.))

src/stdlib_stats_median.fypp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ submodule (stdlib_stats) stdlib_stats_median
1111
! Use "ord_sort" rather than "sort" because the former can be much faster for arrays
1212
! that are already partly sorted. While it is slightly slower for random arrays,
1313
! ord_sort seems a better overall choice.
14-
use stdlib_sorting, only:sort => ord_sort
14+
use stdlib_sorting, only: sort => ord_sort
1515
implicit none
1616

1717
contains

src/tests/stats/test_median.fypp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ program test_median
55
use stdlib_kinds, only: sp, dp, qp, &
66
int8, int16, int32, int64
77
use stdlib_stats, only: median, mean
8-
use,intrinsic :: ieee_arithmetic, only : ieee_is_nan
8+
use, intrinsic :: ieee_arithmetic, only : ieee_is_nan
99
implicit none
1010
real(sp), parameter :: sptol = 1000 * epsilon(1._sp)
1111
real(dp), parameter :: dptol = 2000 * epsilon(1._dp)
@@ -112,7 +112,7 @@ subroutine test_median_${k1}$()
112112
call check(size(d0) == 0, 'test_median_${k1}$: should be of size 0')
113113

114114
d1 = [10., 2., -3., -4., 6., -6., 7., -8., 9., 0., 1., 20.]
115-
call check(mod(size(d1), 2) == 0, 'stest_median_${k1}$: hould be an even number')
115+
call check(mod(size(d1), 2) == 0, 'test_median_${k1}$: should be an even number')
116116

117117
d2 = reshape(d1, [3, 4])
118118
call check(mod(size(d2), 2) == 0, 'test_median_${k1}$: should be an even number')

0 commit comments

Comments
 (0)