Use correct NumberStyle when parsing double and float (#59205)
authorRichard Šefr <richard.sefr@gmail.com>
Mon, 20 Sep 2021 15:35:58 +0000 (17:35 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Sep 2021 15:35:58 +0000 (08:35 -0700)
commit7691aa88ef3e7837e903ce95389e38a112a981c9
tree57813daa2329a86e5af99ded7f4ca8cc84e7a243
parentd498440003be5dbd1f56fdc3a29368a8e34e83c1
Use correct NumberStyle when parsing double and float (#59205)

* User correct NumberStyle when parsing double and float

IParseable<float> and IParseable<double> would fail when parsing
a decimal point number due to incorrect NumberStyles parameter.

E.g. IParseable<double>.TryParse would fail as opposed to
IParseable<double>.Parse because the former explicitly states to use
NumberStyles.Integer

* Adding tests covering parse for float/double/half

* Delete MSBuild_pid-37116_6904092b1c9a481da960c9e28eba2a27.failure.txt

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
src/libraries/System.Private.CoreLib/src/System/Double.cs
src/libraries/System.Private.CoreLib/src/System/Half.cs
src/libraries/System.Private.CoreLib/src/System/Single.cs
src/libraries/System.Runtime.Experimental/tests/System.Runtime.Experimental.Tests.csproj
src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj
src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs [new file with mode: 0644]
src/libraries/System.Runtime/tests/System/GenericMathHelpers.cs
src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs [new file with mode: 0644]
src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs [new file with mode: 0644]