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
Comparisons of negative values to 0.0 will always succeed
Eg. assert_that_double(-500, is_equal_to_double(0));
Occurs because the largest absolute value is computed from the absolute of the max of the values. It should be the max of the absolute values.
Relative epsilon calculations with 0 and a very small number will fail
Eg. assert_that_double(0.000000000000001, is_equal_to_double(0));
Occurs because the implementation uses relative epsilons. The valid range for the above example is computed as [0.000000000000001001, 0.000000000000000999] if there are 4 significant figures. Thus, 0 should fail, but it is unintuitive.
Comparisons of 0 with 0 rely on a integer overflow
First of all, we should not be passing an invalid domain (0) to log10()
Second of all, we should not be casting –Inf to integer then do a subtraction on it. This will cause an overflow.
Comparisons with extremely small numbers will always return a failure
Eg. assert_that_double(4.9406564584124654E-324, is_equal_to_double(4.9406564584124654E-324));
Occurs because the calculated relative epsilon is smaller than the smallest real double value (represented by bits). This can be fixed by assigning the smallest real double as the relative epsilon, instead of letting the math go to 0
Note that issue 1 is a critical bug and should be fixed first (ASAP).
The text was updated successfully, but these errors were encountered:
Comparisons of negative values to 0.0 will always succeed
Eg. assert_that_double(-500, is_equal_to_double(0));
Occurs because the largest absolute value is computed from the absolute of the max of the values. It should be the max of the absolute values.
Relative epsilon calculations with 0 and a very small number will fail
Eg. assert_that_double(0.000000000000001, is_equal_to_double(0));
Occurs because the implementation uses relative epsilons. The valid range for the above example is computed as [0.000000000000001001, 0.000000000000000999] if there are 4 significant figures. Thus, 0 should fail, but it is unintuitive.
Comparisons of 0 with 0 rely on a integer overflow
First of all, we should not be passing an invalid domain (0) to log10()
Second of all, we should not be casting –Inf to integer then do a subtraction on it. This will cause an overflow.
Comparisons with extremely small numbers will always return a failure
Eg. assert_that_double(4.9406564584124654E-324, is_equal_to_double(4.9406564584124654E-324));
Occurs because the calculated relative epsilon is smaller than the smallest real double value (represented by bits). This can be fixed by assigning the smallest real double as the relative epsilon, instead of letting the math go to 0
Note that issue 1 is a critical bug and should be fixed first (ASAP).
The text was updated successfully, but these errors were encountered: