24.123. Math.sqrt( ): compute a square rootECMAScript v124.123.1. SynopsisMath.sqrt(x) 24.123.1.1. Arguments
24.123.1.2. ReturnsThe square root of x. Returns NaN if x is less than zero. 24.123.2. DescriptionMath.sqrt( ) computes the square root of a number. Note, however, that you can compute arbitrary roots of a number with Math.pow( ). For example: Math.cuberoot = function(x){ return Math.pow(x,1/3); } Math.cuberoot(8); // Returns 2 |