Update sqrt_double.cpp

This commit is contained in:
DarkWarrior703 2020-04-25 16:28:31 +03:00 committed by GitHub
parent e9a0234cbe
commit c8f11deea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,8 +12,8 @@ double Sqrt(double x) {
between 1e-7 and 1e-12.
double epsilon = 1e-12;
*/
while ( l <= r) {
double mid = (l + r) / 2;
while ( l <= r ) {
double mid = ( l + r ) / 2;
if ( mid * mid > x ) {
r = mid;
} else {
@ -25,7 +25,6 @@ double Sqrt(double x) {
}
return -1;
}
int main() {
double n{};
std::cin >> n;