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
Thanks for the bug report, that does seem against expectations (see below).
It’s been a while since the last activity on this library - myself, I’ve been over in Go- and Python-land. If you have the bandwidth to prepare a PR, that’d go a long way towards getting the change in. ComparableArg.double.cs is a starting place.
Performance checklist
I don’t have concerns over using a method call here instead of ==, since the result is incorrect today. We do want to avoid boxing/allocations on the happy path to decrease upgrade-cost to consumers (double.Equals instead of casting to an IComparable as mentioned below should do the job efficiently).
Work around
If that’s not possible at this time, you could use the Extension Method support to locally add…
static double IsNotNaN(this Param<double> src)
Confirmation
In the BCL == is false but any method-based equality or comparison is True
If the double typehint is lost in EnsureThat, and IComparable<double> is kept instead, the result is true (The IComparable method uses CompareTo, the double override-method uses ==)
Please add support for checking if a double or float has or does not have a value of NaN.
checking that a double or float has a value like this
Ensure.That(x).IsNot(double.NaN)
does not work. see https://learn.microsoft.com/en-us/dotnet/api/system.double.nan?view=net-8.0The text was updated successfully, but these errors were encountered: