summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/Tutorial/Step2/tutorial.cxx8
-rw-r--r--Tests/Tutorial/Step3/tutorial.cxx8
-rw-r--r--Tests/Tutorial/Step4/tutorial.cxx8
-rw-r--r--Tests/Tutorial/Step5/tutorial.cxx8
-rw-r--r--Tests/Tutorial/Step6/tutorial.cxx8
-rw-r--r--Tests/Tutorial/Step7/tutorial.cxx8
6 files changed, 36 insertions, 12 deletions
diff --git a/Tests/Tutorial/Step2/tutorial.cxx b/Tests/Tutorial/Step2/tutorial.cxx
index 82b416f..c27da0b 100644
--- a/Tests/Tutorial/Step2/tutorial.cxx
+++ b/Tests/Tutorial/Step2/tutorial.cxx
@@ -21,12 +21,16 @@ int main (int argc, char *argv[])
}
double inputValue = atof(argv[1]);
+ double outputValue = 0;
+ if(inputValue >= 0)
+ {
#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
+ outputValue = mysqrt(inputValue);
#else
- double outputValue = sqrt(inputValue);
+ outputValue = sqrt(inputValue);
#endif
+ }
fprintf(stdout,"The square root of %g is %g\n",
inputValue, outputValue);
diff --git a/Tests/Tutorial/Step3/tutorial.cxx b/Tests/Tutorial/Step3/tutorial.cxx
index 82b416f..c27da0b 100644
--- a/Tests/Tutorial/Step3/tutorial.cxx
+++ b/Tests/Tutorial/Step3/tutorial.cxx
@@ -21,12 +21,16 @@ int main (int argc, char *argv[])
}
double inputValue = atof(argv[1]);
+ double outputValue = 0;
+ if(inputValue >= 0)
+ {
#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
+ outputValue = mysqrt(inputValue);
#else
- double outputValue = sqrt(inputValue);
+ outputValue = sqrt(inputValue);
#endif
+ }
fprintf(stdout,"The square root of %g is %g\n",
inputValue, outputValue);
diff --git a/Tests/Tutorial/Step4/tutorial.cxx b/Tests/Tutorial/Step4/tutorial.cxx
index 82b416f..c27da0b 100644
--- a/Tests/Tutorial/Step4/tutorial.cxx
+++ b/Tests/Tutorial/Step4/tutorial.cxx
@@ -21,12 +21,16 @@ int main (int argc, char *argv[])
}
double inputValue = atof(argv[1]);
+ double outputValue = 0;
+ if(inputValue >= 0)
+ {
#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
+ outputValue = mysqrt(inputValue);
#else
- double outputValue = sqrt(inputValue);
+ outputValue = sqrt(inputValue);
#endif
+ }
fprintf(stdout,"The square root of %g is %g\n",
inputValue, outputValue);
diff --git a/Tests/Tutorial/Step5/tutorial.cxx b/Tests/Tutorial/Step5/tutorial.cxx
index 82b416f..c27da0b 100644
--- a/Tests/Tutorial/Step5/tutorial.cxx
+++ b/Tests/Tutorial/Step5/tutorial.cxx
@@ -21,12 +21,16 @@ int main (int argc, char *argv[])
}
double inputValue = atof(argv[1]);
+ double outputValue = 0;
+ if(inputValue >= 0)
+ {
#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
+ outputValue = mysqrt(inputValue);
#else
- double outputValue = sqrt(inputValue);
+ outputValue = sqrt(inputValue);
#endif
+ }
fprintf(stdout,"The square root of %g is %g\n",
inputValue, outputValue);
diff --git a/Tests/Tutorial/Step6/tutorial.cxx b/Tests/Tutorial/Step6/tutorial.cxx
index 82b416f..c27da0b 100644
--- a/Tests/Tutorial/Step6/tutorial.cxx
+++ b/Tests/Tutorial/Step6/tutorial.cxx
@@ -21,12 +21,16 @@ int main (int argc, char *argv[])
}
double inputValue = atof(argv[1]);
+ double outputValue = 0;
+ if(inputValue >= 0)
+ {
#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
+ outputValue = mysqrt(inputValue);
#else
- double outputValue = sqrt(inputValue);
+ outputValue = sqrt(inputValue);
#endif
+ }
fprintf(stdout,"The square root of %g is %g\n",
inputValue, outputValue);
diff --git a/Tests/Tutorial/Step7/tutorial.cxx b/Tests/Tutorial/Step7/tutorial.cxx
index 82b416f..c27da0b 100644
--- a/Tests/Tutorial/Step7/tutorial.cxx
+++ b/Tests/Tutorial/Step7/tutorial.cxx
@@ -21,12 +21,16 @@ int main (int argc, char *argv[])
}
double inputValue = atof(argv[1]);
+ double outputValue = 0;
+ if(inputValue >= 0)
+ {
#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
+ outputValue = mysqrt(inputValue);
#else
- double outputValue = sqrt(inputValue);
+ outputValue = sqrt(inputValue);
#endif
+ }
fprintf(stdout,"The square root of %g is %g\n",
inputValue, outputValue);