summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx
diff options
context:
space:
mode:
authorMarkus Ferrell <markus.ferrell@kitware.com>2022-07-20 17:24:40 (GMT)
committerMarkus Ferrell <markus.ferrell@kitware.com>2022-08-08 21:15:48 (GMT)
commitccba87b05b022cc021580b65ae51bbae0002fadb (patch)
treee90c94d2bb65845b23c483dae801cfbd8cf498d3 /Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx
parentad20e7b2ae6e698b6778f0572f1a03fdf1fcacda (diff)
downloadCMake-ccba87b05b022cc021580b65ae51bbae0002fadb.zip
CMake-ccba87b05b022cc021580b65ae51bbae0002fadb.tar.gz
CMake-ccba87b05b022cc021580b65ae51bbae0002fadb.tar.bz2
Tutorial: Move step 10 to step 4
Shifts steps 4-9 to 5-10.
Diffstat (limited to 'Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx')
-rw-r--r--Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx8
1 files changed, 0 insertions, 8 deletions
diff --git a/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx
index 7eecd26..abe767d 100644
--- a/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx
+++ b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx
@@ -1,4 +1,3 @@
-#include <cmath>
#include <iostream>
#include "MathFunctions.h"
@@ -10,12 +9,6 @@ double mysqrt(double x)
return 0;
}
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = std::exp(std::log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result
- << " using log and exp" << std::endl;
-#else
double result = x;
// do ten iterations
@@ -27,6 +20,5 @@ double mysqrt(double x)
result = result + 0.5 * delta / result;
std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-#endif
return result;
}