UNPKG
chromatism2
Version:
latest (3.0.2)
3.0.2
3.0.1
A simple set of utility functions for colours.
github.com/tehshrike/chromatism
tehshrike/chromatism
chromatism2
/
src
/
helpers
/
cube-root.js
9 lines
(8 loc)
•
167 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
export
default
function
cubeRoot
(
x
) {
if
(!
Math
.
cbrt
) {
var
y =
Math
.
pow
(
Math
.
abs
(x),
1
/
3
)
return
x <
0
? -y : y }
else
{
return
Math
.
cbrt
(x) } }