You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Division by zero is not supported by the current implementation.
To Reproduce
When compute an arithmetic operation Divides composed of two numbers MyNumber(8) and MyNumber(0),
then computing the value of this number with method computes() returns an
java.lang.ArithmeticException: / by zero
Expected behavior
When trying to divide by a 0 integer, the error should be properly handled (using the Java exception handling mechanism for example), for example to return NaN (or something similar), rather then leading to an exception at runtime.
Tests needed
Unit tests ad BDD tests also need to be added to detect this bug and to ensure that it will not reappear somewhere in the future.
Additional context
When extending the calculator to more general number domains and other arithmetic operations, please be beware of similar restrictions that may apply (in the appropriate number domain), such as logarithms of negative values, which cannot exist in the real number set; but can exist in the complex number set.
The text was updated successfully, but these errors were encountered:
Describe the bug
Division by zero is not supported by the current implementation.
To Reproduce
When compute an arithmetic operation Divides composed of two numbers MyNumber(8) and MyNumber(0),
then computing the value of this number with method computes() returns an
java.lang.ArithmeticException: / by zero
Expected behavior
When trying to divide by a 0 integer, the error should be properly handled (using the Java exception handling mechanism for example), for example to return NaN (or something similar), rather then leading to an exception at runtime.
Tests needed
Unit tests ad BDD tests also need to be added to detect this bug and to ensure that it will not reappear somewhere in the future.
Additional context
When extending the calculator to more general number domains and other arithmetic operations, please be beware of similar restrictions that may apply (in the appropriate number domain), such as logarithms of negative values, which cannot exist in the real number set; but can exist in the complex number set.
The text was updated successfully, but these errors were encountered: