summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-05-30 01:38:54 -0700
committerFuwn <[email protected]>2022-05-30 01:38:54 -0700
commitf5e26961a609464482e03eeb884c187caeebb763 (patch)
tree48f2b70e2ad1e7035d39a83c235988f4a04b40a8
parentfeat: c++14 support (diff)
downloadellipse-f5e26961a609464482e03eeb884c187caeebb763.tar.xz
ellipse-f5e26961a609464482e03eeb884c187caeebb763.zip
fix(ellipse): move variable declrations
-rw-r--r--ellipse/ellipse.cc5
-rw-r--r--ellipse/test.cc6
2 files changed, 5 insertions, 6 deletions
diff --git a/ellipse/ellipse.cc b/ellipse/ellipse.cc
index 0437d28..514b262 100644
--- a/ellipse/ellipse.cc
+++ b/ellipse/ellipse.cc
@@ -60,7 +60,7 @@ void ellipse::calculate() {
((1 + ((3 * h)) / (10 + std::sqrt(4 - (3 * h)))));
}
- // This belongs to the two calculates below.
+ // This belongs to the two calculations below.
// std::function<double(double)> factorial;
//
// factorial = [&factorial](double n) -> double {
@@ -89,8 +89,7 @@ void ellipse::calculate() {
// this->circumference = 2 * this->major * pi * (1 - h);
// }
- // Or this either... however, it is not complete enough to guarantee 100%
- // accurate results.
+ // Or this either...
// {
// double limit = std::numeric_limits<double>::infinity();
// double infinite_sum = 0;
diff --git a/ellipse/test.cc b/ellipse/test.cc
index 6c1b86a..222d9ea 100644
--- a/ellipse/test.cc
+++ b/ellipse/test.cc
@@ -10,17 +10,17 @@
int main() {
// Create one ellipse object immediately and ...
ellipse e;
+ double major;
+ double minor;
// call the get_ellipse_description function.
e.get_ellipse_description();
for (;;) {
- double major;
- double minor;
-
std::cout << "major: ";
std::cin >> major;
+ // For testing and responsiveness
if (major < 0) {
break;
}