File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
tests/FSharp.Core.UnitTests/FSharp.Core Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -4167,7 +4167,7 @@ namespace Microsoft.FSharp.Core
41674167 else ( # " ceq" e1 e1 : int #)
41684168 when ^T : float32 = if ( # " clt" e1 e2 : bool #) then (- 1 )
41694169 elif ( # " cgt" e1 e2 : bool #) then ( 1 )
4170- elif ( # " ceq" e1 e2 : bool #) then ( 1 )
4170+ elif ( # " ceq" e1 e2 : bool #) then ( 0 )
41714171 elif ( # " ceq" e2 e2 : bool #) then (- 1 )
41724172 else ( # " ceq" e1 e1 : int #)
41734173 when ^T : char = if ( # " clt.un" e1 e2 : bool #) then (- 1 ) else ( # " cgt.un" e1 e2 : int #)
Original file line number Diff line number Diff line change @@ -816,3 +816,16 @@ type RangeTests() =
816816 if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned ( System.UIntPtr System.UInt64.MinValue) ( System.UIntPtr System.UInt64.MaxValue)
817817
818818
819+ open NonStructuralComparison
820+
821+
822+ [<TestFixture>]
823+ type NonStructuralComparisonTests () =
824+
825+ [<Test>]
826+ member __.CompareFloat32 () = // https://github.com/Microsoft/visualfsharp/pull/4493
827+
828+ let x = 32 |> float32
829+ let y = 32 |> float32
830+ let comparison = compare x y
831+ Assert.AreEqual( 0 , comparison)
You can’t perform that action at this time.
0 commit comments