-
Notifications
You must be signed in to change notification settings - Fork 0
median
Subhajit Sahu edited this page Aug 9, 2022
·
2 revisions
Find the value separating the higher and lower halves of numbers.
function median(...xs)
// xs: a list of numbers
const xnumber = require('extra-number');
xnumber.median(1, 7);
// → 4
xnumber.median(1, 7, 8);
// → 7
xnumber.median(1, 7, 8, 10);
// → 7.5