Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix the zero calculation in Pythagorean Theorem Calculator #1811

Closed
4 of 7 tasks
srilekha279 opened this issue Aug 8, 2024 · 9 comments · Fixed by #1828
Closed
4 of 7 tasks

[Bug] Fix the zero calculation in Pythagorean Theorem Calculator #1811

srilekha279 opened this issue Aug 8, 2024 · 9 comments · Fixed by #1828
Assignees
Labels
bug 🐞 Something isn't working enhancement ✨ New feature or request gssoc GSSoC 2k24 Open Source Program level1 GSSoC2k24 Level-1 Task -- 10 Points

Comments

@srilekha279
Copy link
Contributor

Description

The current implementation of the hypotenuse calculator has a bug where it incorrectly calculates the hypotenuse when one of the sides is entered as zero.

Steps to Reproduce:

  • Open the calculator and input 0 as one of the sides (e.g., side a).
  • Enter a non-zero value as the other side (e.g., side b).
  • The calculator incorrectly calculates the hypotenuse.

What I want to improve

  • Fix the bug

Input Handling:

Allow users to input values into three fields: side a, side b, and hypotenuse.
Calculations: Implement logic to:

  • Calculate the hypotenuse if two sides are given.
  • Calculate the missing side if the hypotenuse and one side are given.
  • Validate the triplet if all three sides are given.

Screenshots

Screenshot (922)

Checklist

  • I have checked the existing issues.
  • I follow Contributing Guidelines of this project.
  • I am a GSSOC'24 contributor.
  • I am a IWOC'24 contributor.
  • I am a JWOC'24 contributor.
  • I am a SWOC'24 contributor.

Code of Conduct

Copy link

github-actions bot commented Aug 8, 2024

Hey @srilekha279, Welcome to the project CalcDiverse! 🎊
Thanks for opening an issue! 🙌 Please wait for the issue to be assigned. Happy Coding!! ✨

@Rakesh9100
Copy link
Owner

Go ahead @srilekha279

@Rakesh9100 Rakesh9100 changed the title [Bug & Enhancement] Incorrect Calculation with Zero as a Side in Pythagorean Theorem Calculator [Bug] Fix the zero calculation in Pythagorean Theorem Calculator Aug 8, 2024
@Rakesh9100 Rakesh9100 added the gssoc GSSoC 2k24 Open Source Program label Aug 8, 2024
@srilekha279
Copy link
Contributor Author

srilekha279 commented Aug 8, 2024

Go ahead @srilekha279

Should I fix the bug first and then raise a separate issue for the enhancement?

@Rakesh9100
Copy link
Owner

What kind of enhancement @srilekha279

@srilekha279
Copy link
Contributor Author

What kind of enhancement @srilekha279

Instead of taking two sides as input, I want to take 3 sides as input and calculate the missing side if the hypotenuse and one side are given, calculate the hypotenuse if 2 other sides are given and
validate the triplet if all three sides are given.

@Rakesh9100
Copy link
Owner

You just fix the bug in this issue by creating a PR, we already have Pythagorean Triples Calculator @srilekha279

@srilekha279
Copy link
Contributor Author

You just fix the bug in this issue by creating a PR, we already have Pythagorean Triples Calculator @srilekha279

I understand that the current Pythagorean Triples Calculator validates triplets, but I believe adding the following feature will significantly enhance its functionality

Calculate Missing Side: If the hypotenuse and one side are given.

The current Pythagorean Triplet Calculator only checks whether a triplet is valid. I propose to calculate any side of a right triangle, not just the hypotenuse.

Screenshot (924)

@srilekha279
Copy link
Contributor Author

@Rakesh9100
Please accept my pull request.

Copy link

Hello @srilekha279! Your issue #1811 has been closed. Thank you for your contribution!! 🙌

@Rakesh9100 Rakesh9100 added bug 🐞 Something isn't working enhancement ✨ New feature or request level1 GSSoC2k24 Level-1 Task -- 10 Points labels Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working enhancement ✨ New feature or request gssoc GSSoC 2k24 Open Source Program level1 GSSoC2k24 Level-1 Task -- 10 Points
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants