andy-h
2/7/2014 - 2:28 PM

Get the nth root of a number, where n is the degree of the root. For example, get the cube root of 27 using Math.root(27, 3).

Get the nth root of a number, where n is the degree of the root. For example, get the cube root of 27 using Math.root(27, 3).

if(!Math.root){
	Math.root = function root(num, degree){
		return Math.pow(num, (1/degree));
	};
}