]> gerrit.simantics Code Review - simantics/district.git/blob - cbrt/shim.js
Hide "enabled" column for non-component type tech type tables
[simantics/district.git] / 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 };