mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-26 05:15:19 +00:00
Remove unused code
This commit is contained in:
parent
ba05606074
commit
0f204eebe1
1 changed files with 0 additions and 11 deletions
|
@ -1,11 +0,0 @@
|
|||
/**
|
||||
* 中央値を求めます
|
||||
* @param samples サンプル
|
||||
*/
|
||||
export default function(samples) {
|
||||
if (!samples.length) return 0;
|
||||
const numbers = samples.slice(0).sort((a, b) => a - b);
|
||||
const middle = Math.floor(numbers.length / 2);
|
||||
const isEven = numbers.length % 2 === 0;
|
||||
return isEven ? (numbers[middle] + numbers[middle - 1]) / 2 : numbers[middle];
|
||||
}
|
Loading…
Reference in a new issue