]> git.r.bdr.sh - rbdr/dotfiles/blob
bca196026c730acc875cac7d29e033f5b38c10cf
[rbdr/dotfiles] /
1 'use strict';
2
3 var pow = Math.pow;
4
5 module.exports = function (x) {
6 if (isNaN(x)) return NaN;
7 x = Number(x);
8 if (x === 0) return x;
9 if (!isFinite(x)) return x;
10 if (x < 0) return -pow(-x, 1 / 3);
11 return pow(x, 1 / 3);
12 };