From d30573caeadf1c13e470a93b89d9b82f95fedef3 Mon Sep 17 00:00:00 2001 From: Tyler Wagenman Date: Mon, 31 Aug 2026 11:55:10 -0700 Subject: [PATCH 1/3] Fixing NaN error for division operations. --- main.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) mode change 100644 => 100755 main.cpp diff --git a/main.cpp b/main.cpp old mode 100644 new mode 100755 index 5411e7a3..b6b20c47 --- a/main.cpp +++ b/main.cpp @@ -16,8 +16,18 @@ int main() cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; - cout << "Division: " << x / y << endl; - cout << "Remainder: " << x % y << endl; + if (y == 0) + { + cout << "Diving by zero is not a number." << endl; + } + else + { + cout << "Division: " << x / y << endl; + cout << "Remainder: " << x % y << endl; + } + + //cout << "Division: " << x / y << endl; + //cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; cout << "Square: " << pow(x, y) << endl; From d7a2e4b5a067a93e3a3bb98de104278987947b59 Mon Sep 17 00:00:00 2001 From: Mernon Date: Mon, 31 Aug 2026 11:57:32 -0700 Subject: [PATCH 2/3] Fix indentation for remainder output --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index b6b20c47..b98fecea 100755 --- a/main.cpp +++ b/main.cpp @@ -23,7 +23,7 @@ int main() else { cout << "Division: " << x / y << endl; - cout << "Remainder: " << x % y << endl; + cout << "Remainder: " << x % y << endl; } //cout << "Division: " << x / y << endl; From 4d1ec1d8ae1607e075d330d321da3229183e92b7 Mon Sep 17 00:00:00 2001 From: Tyler Wagenman Date: Wed, 2 Sep 2026 11:39:43 -0700 Subject: [PATCH 3/3] Fixed indent? --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index b98fecea..b6b20c47 100755 --- a/main.cpp +++ b/main.cpp @@ -23,7 +23,7 @@ int main() else { cout << "Division: " << x / y << endl; - cout << "Remainder: " << x % y << endl; + cout << "Remainder: " << x % y << endl; } //cout << "Division: " << x / y << endl;