function nthRoot(num, nArg, precArg) { var n = nArg || 2; var prec = precArg || 12; var x = 1; // Initial guess. for (var i=0; i