You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/specs/stdlib_stats.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -189,14 +189,14 @@ Experimental
189
189
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`.
190
190
191
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` are defined as, if
193
-
`n = size(array)` is an even number:
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:
`array`: Shall be an array of type `integer` or `real`.
220
+
`array`: Shall be an array of type `integer` or `real`.
221
221
222
222
`dim`: Shall be a scalar of type `integer` with a value in the range from 1 to `n`, where `n` is the rank of `array`.
223
223
224
224
`mask` (optional): Shall be of type `logical` and either a scalar or an array of the same shape as `array`.
225
225
226
226
### Return value
227
227
228
-
If `array` is of type `real`, the result is of the same type as `array`.
228
+
If `array` is of type `real`, the result is of type `real` with the same kind as `array`.
229
229
If `array` is of type `integer`, the result is of type `real(dp)`.
230
230
231
231
If `dim` is absent, a scalar with the median 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.
0 commit comments