Step 10
This commit is contained in:
parent
b0cc498b07
commit
43746571c9
|
@ -6,8 +6,11 @@ let interpolate =
|
||||||
yMin *. minProportion +. yMax *. maxProportion;
|
yMin *. minProportion +. yMax *. maxProportion;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @todo: To test!
|
||||||
/* https://bucklescript.github.io/bucklescript/api/Belt.html */
|
/* https://bucklescript.github.io/bucklescript/api/Belt.html */
|
||||||
let sum = Belt.Array.reduce(_, 0., (i, j) => i +. j);
|
let sum = Belt.Array.reduce(_, 0., (i, j) => i +. j);
|
||||||
let mean = a => sum(a) /. (Array.length(a) |> float_of_int);
|
let mean = a => sum(a) /. (Array.length(a) |> float_of_int);
|
||||||
let min = Belt.Array.reduce(_, 0., (i, j) => i < j ? i : j);
|
let min = Belt.Array.reduce(_, 0., (i, j) => i < j ? i : j);
|
||||||
let max = Belt.Array.reduce(_, 0., (i, j) => i > j ? i : j);
|
let max = Belt.Array.reduce(_, 0., (i, j) => i > j ? i : j);
|
||||||
|
let up = (a, b) => Array.make(b - a, a) |> Array.mapi((i, c) => c + i);
|
||||||
|
let down = (a, b) => Array.make(a - b, a) |> Array.mapi((i, c) => c - i);
|
||||||
|
|
|
@ -108,6 +108,7 @@ function random(min, max) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @Done
|
||||||
* @param {number} from
|
* @param {number} from
|
||||||
* @param {number} to
|
* @param {number} to
|
||||||
* @return {number[]}
|
* @return {number[]}
|
||||||
|
@ -119,6 +120,7 @@ function up(from, to) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @Done
|
||||||
* @param {number} from
|
* @param {number} from
|
||||||
* @param {number} to
|
* @param {number} to
|
||||||
* @return {number[]}
|
* @return {number[]}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user