summaryrefslogtreecommitdiff
path: root/Help/guide/tutorial/Step2/MathFunctions/MathFunctions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Help/guide/tutorial/Step2/MathFunctions/MathFunctions.cxx')
-rw-r--r--Help/guide/tutorial/Step2/MathFunctions/MathFunctions.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Help/guide/tutorial/Step2/MathFunctions/MathFunctions.cxx b/Help/guide/tutorial/Step2/MathFunctions/MathFunctions.cxx
new file mode 100644
index 0000000000..781d0ecc4e
--- /dev/null
+++ b/Help/guide/tutorial/Step2/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,15 @@
+#include "MathFunctions.h"
+
+// TODO 11: include cmath
+
+// TODO 10: Wrap the mysqrt include in a precompiled ifdef based on USE_MYMATH
+#include "mysqrt.h"
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+ // TODO 9: If USE_MYMATH is defined, use detail::mysqrt.
+ // Otherwise, use std::sqrt.
+ return detail::mysqrt(x);
+}
+}