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
Actually, your question is not the exact same issue as 1193 since it does not involve units in the equality, so I will answer here.
This is generally due to double precision in arithmetic, you can't assume it will always be perfectly 1000. When comparing double values, you should always specify a max error tolerance. Most unit test frameworks provide this or you can write your own.
For example, FluentAssertions has value.Should().BeApproximately(3.14, 0.01);
Describe the bug
Given this unit test:
The test fails with:
It seems that working with small units means that the precision of the calculations are not correct?
Using version 5.1.0
The text was updated successfully, but these errors were encountered: