It is known that Alibaba is a great international company.Maybe @kdn251 can open a catalog:interviews/company/Alibaba.
For example,a 2019 Alibaba interview question.
//Question: you need to caculate sqrt(2) to 10 decimal places accurately without math library.double sqrt2( ) { double low = 1.4, high = 1.5; double mid = (low + high) / 2; while (high – low > 0.0000000001) { if (mid*mid < 2) { high = mid; } else { low = mid; } mid = (high + low) / 2; } return mid; }
It is known that Alibaba is a great international company.Maybe @kdn251 can open a catalog:interviews/company/Alibaba. For example,a 2019 Alibaba interview question. //Question: you need to caculate sqrt(2) to 10 decimal places accurately without math library.
double sqrt2( ) { double low = 1.4, high = 1.5; double mid = (low + high) / 2; while (high – low > 0.0000000001) { if (mid*mid < 2) { high = mid; } else { low = mid; } mid = (high + low) / 2; } return mid; }