]> git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/shim.js
bca196026c730acc875cac7d29e033f5b38c10cf
[rbdr/dotfiles] / atom / packages / vim-mode / node_modules / grim / node_modules / emissary / node_modules / es6-weak-map / node_modules / es5-ext / math / cbrt / shim.js
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 };