Minor cleanups for System.Runtime.Numerics (#53984)
authorHuo Yaoyuan <huoyaoyuan@hotmail.com>
Mon, 2 Aug 2021 16:36:11 +0000 (00:36 +0800)
committerGitHub <noreply@github.com>
Mon, 2 Aug 2021 16:36:11 +0000 (09:36 -0700)
commit65439deaef6a4f7e9184a14ce7170ae1363c89a1
treee993773a0d5d0bac4793a7ecaa55bc747438c215
parentbb7e7f9251ce1306f83266306300eefeb0a1dc44
Minor cleanups for System.Runtime.Numerics (#53984)

* Replace union with BitConverter

* Replace CombineHash with HashCode

* Replace CbitHighZero with LeadingZeroCount

* Remove another LeadingZeros

* More cleanup in BigInteger

* Cleanup complex

* Apply suggestions from code review

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
* Convert body-less for to while

* Use HashCode.AddBytes

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.GcdInv.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/Complex.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/NumericsHelpers.cs