-
Notifications
You must be signed in to change notification settings - Fork 832
Closed
Labels
Milestone
Description
Please provide a succinct description of the issue.
I just noticed this weird behavior when comparing nan with doubles.
But, when I try using the Array.min, it gives the "correct" result (which is inconsistent):
Repro steps
- Start
fsi;
> open System;;
> Double.Min(nan, -1.);;
val it: float = nan
> Double.Max(nan, -1.);;
val it: float = nan
> let testArray : double array = [| 0.0; nan; 0.0; 0.0; 0.0; -0.3814976554; -0.0; 0.0 |];
val testArray: double array =
[|0.0; nan; 0.0; 0.0; 0.0; -0.3814976554; -0.0; 0.0|]
> Array.min(testArray);;
val it: double = -0.3814976554Expected behavior
I was expecting that a number would be always bigger and less than any nan.
What is the rationale for the other way around?
Actual behavior
It's informed at the repro steps section.
This happens when using System.Numerics.Vector too:
Known workarounds
Related information
Provide any related information (optional):
- Operating system: Linux
- .NET Runtime kind (.NET Core, .NET Framework, Mono): .NET 10
- Editing Tools (e.g. Visual Studio Version, Visual Studio): -
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New