Implement IEEE754 totalOrder comparer (#75517)
authorHuo Yaoyuan <huoyaoyuan@hotmail.com>
Sat, 24 Sep 2022 16:28:17 +0000 (00:28 +0800)
committerGitHub <noreply@github.com>
Sat, 24 Sep 2022 16:28:17 +0000 (09:28 -0700)
commitbaab095d594692cb55f4d283dea614c95c5b83cb
tree34c3d855852acf1e270dd7cd8febf095a8808b74
parente823a080eacdd35505e5d019d0a9e4c5cf395af3
Implement IEEE754 totalOrder comparer (#75517)

* Basic implementation of total order

* Add public api reference

* Add basic tests

* Apply suggestions from code review

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
* Update xmldoc

* Update comparison logic to save calls

* Handle order of NaN

* Implement integer comparison semantic

* Change NaN semantic in fallback comparison

* Adjust test data

* Change to struct

* Fix ApiCompat

* Manually apply suggestion from review

* Defensive for custom float-point

* Nit

* Fix comments

* Implement Equals and GetHashCode

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
src/libraries/System.Private.CoreLib/src/System/Numerics/TotalOrderIeee754Comparer.cs [new file with mode: 0644]
src/libraries/System.Runtime/ref/System.Runtime.cs
src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj
src/libraries/System.Runtime/tests/System/Numerics/TotalOrderIeee754ComparerTests.cs [new file with mode: 0644]