-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
assert two NaN values #624
Comments
@yahelmanor2 NaN its not a number, so you can't compare those 2 values. |
thanks @devdinu,but there is any way I can test that value equal to |
@yahelmanor2 I think that you should do that :) |
This NaN comparison logic, though not necessarily this function, would be useful to have when comparing deeply nested structs and slices. For example, if I expected to get a slice |
when i try to assert two NaN values the assert result was
the code that genrate this error is
because the
assert.Equal
is based onreflerct.DeepEqual
in it documentations written that two floats a,b will be equal if a == b is true.the golang the act according IEEE 754 is defined NaN == NaN as false.
so this may need discussion about adding assert checking for NaN values.
The text was updated successfully, but these errors were encountered: