From bb1c99dd7608c9f4a1b8cc5384b6305c2b919782 Mon Sep 17 00:00:00 2001 From: aakhan10 Date: Wed, 4 Feb 2026 19:37:29 -0800 Subject: [PATCH 1/4] Handle NaN input, resolve #61 --- main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.cpp b/main.cpp index 5411e7a3..2eb4ec8c 100644 --- a/main.cpp +++ b/main.cpp @@ -16,6 +16,14 @@ int main() cout << "Addition: " << x + y << endl; cout << "Subtraction: " << x - y << endl; cout << "Multiplication: " << x * y << endl; + if (y == 0) + { + cout << "Division: Dividing by zero is not a number." << endl; + } + else + { + cout << "Division: " << x / y << endl; + } cout << "Division: " << x / y << endl; cout << "Remainder: " << x % y << endl; cout << "Square Root: " << sqrt(x) << endl; From 5ca9f1abdf4933cb6d81fa3f7af708bd7c675269 Mon Sep 17 00:00:00 2001 From: aakhan10 Date: Wed, 11 Feb 2026 17:23:37 -0800 Subject: [PATCH 2/4] add ci --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..1991761f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: Build C++ + +on: + push: + branches: + - '**' + +jobs: + install: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential g++ cmake + + build: + runs-on: ubuntu-latest + needs: install + + steps: + - uses: actions/checkout@v3 + + - name: Compile project + run: make + From b17d2b6f2169a7201ede3f0b596d97f7300fd326 Mon Sep 17 00:00:00 2001 From: aakhan10 Date: Wed, 11 Feb 2026 17:33:24 -0800 Subject: [PATCH 3/4] fixed workflow --- .github/workflows/build.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1991761f..7a258089 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,24 +6,17 @@ on: - '**' jobs: - install: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install dependencies + - name: Install compiler run: | sudo apt-get update - sudo apt-get install -y build-essential g++ cmake - - build: - runs-on: ubuntu-latest - needs: install - - steps: - - uses: actions/checkout@v3 + sudo apt-get install -y g++ - - name: Compile project - run: make + - name: Build project + run: g++ -std=c++17 -O2 -Wall -Wextra -o app main.cpp From b662c3645a32afdc7c92d6900b2cd16163b74909 Mon Sep 17 00:00:00 2001 From: aakhan10 Date: Wed, 11 Feb 2026 17:45:33 -0800 Subject: [PATCH 4/4] add status badge --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..c262ff64 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +[![Build C++](https://github.com/aakhan10/MyFirstExample/actions/workflows/build.yml/badge.svg)](https://github.com/aakhan10/MyFirstExample/actions/workflows/build.yml) + +# My First Example +