AyushAgnihotri2025 / Calculator

🧮 Provides simple and advanced mathematical functions in a beautifully designed UI.
https://play.google.com/store/apps/details?id=com.mrayush.calculator
GNU General Public License v3.0
15 stars 22 forks source link

Better method to handle Overflowed answers. #38

Closed AyushAgnihotri2025 closed 1 year ago

AyushAgnihotri2025 commented 1 year ago

Is your feature request related to a problem? Please describe.

As we can see from the above screenshot, the answers which are overflowed are being showed as an Alert Dialog box which doesn't looks much good. So, it should be handled in a more or good manner.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Code of Conduct

dhruv-porwal commented 1 year ago

Better method to handle Overflowed answers::

Overflowed answers can occur in a variety of contexts, such as when a computation exceeds the limits of the data type being used, or when the output of a model or algorithm is too large to be easily processed. Here are some methods to handle overflowed answers:

Use a modulo operation: In some cases, the overflow may occur due to the result being too large to be represented by the available memory. Using a modulo operation to keep the result within a smaller range can help avoid overflow errors.

Use scientific notation: If the values being computed are very large or small, representing them in scientific notation can help avoid overflow errors.

Handle the overflow as an exception: When the overflow occurs, catch the exception and handle it appropriately. For example, you may want to return an error message, or terminate the program gracefully.

We can write a toast message/pop up telling very large values.

TheNPDev commented 1 year ago

Hey @AyushAgnihotri2025 , I also want to work on this issue. Please it to me under IWOC label

AyushAgnihotri2025 commented 1 year ago

Ok you can work 👍 on it @TheNPDev .....

AyushAgnihotri2025 commented 1 year ago

Completed #46