方法一:
int mySqrt(int x) { if(x == 0) { return 0; } int ans = exp(0.5*log(x)); int k = ans+1; //int r = k*k; if((long long) k*k <=x) { return k; } else { return ans; } }
实现sqrt()函数
原文:https://www.cnblogs.com/132818Creator/p/12860502.html