Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libraries/System.Private.CoreLib/src/System/Double.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ static double IParseable<double>.Parse(string s, IFormatProvider? provider)

[RequiresPreviewFeatures]
static bool IParseable<double>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out double result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
// ISignedNumber
Expand All @@ -1257,11 +1257,11 @@ static bool IParseable<double>.TryParse([NotNullWhen(true)] string? s, IFormatPr

[RequiresPreviewFeatures]
static double ISpanParseable<double>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, NumberStyles.Integer, provider);
=> Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);

[RequiresPreviewFeatures]
static bool ISpanParseable<double>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out double result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
// ISubtractionOperators
Expand Down
10 changes: 5 additions & 5 deletions src/libraries/System.Private.CoreLib/src/System/Half.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static bool IsSubnormal(Half value)
public static Half Parse(string s)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseHalf(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.CurrentInfo);
return Number.ParseHalf(s, DefaultParseStyle, NumberFormatInfo.CurrentInfo);
}

/// <summary>
Expand All @@ -266,7 +266,7 @@ public static Half Parse(string s, NumberStyles style)
public static Half Parse(string s, IFormatProvider? provider)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseHalf(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider));
return Number.ParseHalf(s, DefaultParseStyle, NumberFormatInfo.GetInstance(provider));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that this and above are the only changes to non preview code and they're a no-op. (It might have been nice if we used DefaultParseStyle in Float and Double or not at all, so they look the same)

}

/// <summary>
Expand Down Expand Up @@ -1554,7 +1554,7 @@ static Half IParseable<Half>.Parse(string s, IFormatProvider? provider)

[RequiresPreviewFeatures]
static bool IParseable<Half>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out Half result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, DefaultParseStyle, provider, out result);

//
// ISignedNumber
Expand All @@ -1569,11 +1569,11 @@ static bool IParseable<Half>.TryParse([NotNullWhen(true)] string? s, IFormatProv

[RequiresPreviewFeatures]
static Half ISpanParseable<Half>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, NumberStyles.Integer, provider);
=> Parse(s, DefaultParseStyle, provider);

[RequiresPreviewFeatures]
static bool ISpanParseable<Half>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Half result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, DefaultParseStyle, provider, out result);

//
// ISubtractionOperators
Expand Down
6 changes: 3 additions & 3 deletions src/libraries/System.Private.CoreLib/src/System/Single.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ static float IParseable<float>.Parse(string s, IFormatProvider? provider)

[RequiresPreviewFeatures]
static bool IParseable<float>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out float result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
// ISignedNumber
Expand All @@ -1249,11 +1249,11 @@ static bool IParseable<float>.TryParse([NotNullWhen(true)] string? s, IFormatPro

[RequiresPreviewFeatures]
static float ISpanParseable<float>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, NumberStyles.Integer, provider);
=> Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);

[RequiresPreviewFeatures]
static bool ISpanParseable<float>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out float result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
=> TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);

//
// ISubtractionOperators
Expand Down