med

From The K Language Wiki
Revision as of 10:29, 18 August 2021 by Razetime (talk | contribs) (Created page with "{{primitive|med x|in=K7}} '''Med''' computes the median of a list. In K7, chooses the largest element among the middle elements. <pre> med 3 3 3 3 med 3 4 5 4 med 3 4 5...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Med
med x
Supported in K7

Med computes the median of a list.

In K7, chooses the largest element among the middle elements.

 med 3 3 3
3
 med 3 4 5
4
 med 3 4 5 5
5
 med 3 5 4 5
5
 med 3 3 4 5
4