Travis build: 2163 [cron]

This commit is contained in:
30secondsofcode
2018-06-18 21:28:08 +00:00
parent 3197d6ddce
commit 3e16d2ffa4
10 changed files with 1473 additions and 1444 deletions

View File

@ -1,2 +1,2 @@
const degreesToRads = deg => deg * Math.PI / 180.0;
const degreesToRads = deg => (deg * Math.PI) / 180.0;
module.exports = degreesToRads;

View File

@ -4,6 +4,6 @@ num === 0 || num === 24
: num === 12
? 12 + 'pm'
: num < 12
? num % 12 + 'am'
: num % 12 + 'pm';
? (num % 12) + 'am'
: (num % 12) + 'pm';
module.exports = getMeridiemSuffixOfInteger;

View File

@ -1,6 +1,6 @@
const hz = (fn, iterations = 100) => {
const before = performance.now();
for (let i = 0; i < iterations; i++) fn();
return 1000 * iterations / (performance.now() - before);
return (1000 * iterations) / (performance.now() - before);
};
module.exports = hz;

View File

@ -1,6 +1,6 @@
const lcm = (...arr) => {
const gcd = (x, y) => (!y ? x : gcd(y, x % y));
const _lcm = (x, y) => x * y / gcd(x, y);
const _lcm = (x, y) => (x * y) / gcd(x, y);
return [...arr].reduce((a, b) => _lcm(a, b));
};
module.exports = lcm;

View File

@ -4,7 +4,7 @@ let arr = (num + '')
.reverse()
.map(x => parseInt(x));
let lastDigit = arr.splice(0, 1)[0];
let sum = arr.reduce((acc, val, i) => (i % 2 !== 0 ? acc + val : acc + (val * 2) % 9 || 9), 0);
let sum = arr.reduce((acc, val, i) => (i % 2 !== 0 ? acc + val : acc + ((val * 2) % 9) || 9), 0);
sum += lastDigit;
return sum % 10 === 0;
};

View File

@ -1,3 +1,3 @@
const percentile = (arr, val) =>
100 * arr.reduce((acc, v) => acc + (v < val ? 1 : 0) + (v === val ? 0.5 : 0), 0) / arr.length;
(100 * arr.reduce((acc, v) => acc + (v < val ? 1 : 0) + (v === val ? 0.5 : 0), 0)) / arr.length;
module.exports = percentile;

View File

@ -1,2 +1,2 @@
const radsToDegrees = rad => rad * 180.0 / Math.PI;
const radsToDegrees = rad => (rad * 180.0) / Math.PI;
module.exports = radsToDegrees;

File diff suppressed because it is too large Load Diff