mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-05 03:29:46 +08:00
Update sqrt_double.cpp
This commit is contained in:
@@ -16,8 +16,7 @@ double Sqrt(double x) {
|
||||
double mid = (l + r) / 2;
|
||||
if ( mid * mid > x ) {
|
||||
r = mid;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ( x - mid * mid < epsilon ) {
|
||||
return mid;
|
||||
}
|
||||
@@ -25,7 +24,6 @@ double Sqrt(double x) {
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
Reference in New Issue
Block a user