-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix incorrect case sensitivity in floating-point number parsing methods #11641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @dotnet/area-system-runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a suggestion to try and make it more clear that all of the symbols are compared case insensitively.
@@ -4814,7 +4814,7 @@ The following code example illustrates the use of <xref:System.Double.NegativeIn | |||
## Remarks | |||
In .NET Core 3.0 and later, values that are too large to represent are rounded to <xref:System.Double.PositiveInfinity> or <xref:System.Double.NegativeInfinity> as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In .NET Core 3.0 and later, values that are too large to represent are rounded to <xref:System.Double.PositiveInfinity> or <xref:System.Double.NegativeInfinity> as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. | |
In .NET Core 3.0 and later versions, values that are too large to represent are rounded to <xref:System.Double.PositiveInfinity> or <xref:System.Double.NegativeInfinity> as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that's too large to represent results in failure. |
@@ -4814,7 +4814,7 @@ The following code example illustrates the use of <xref:System.Double.NegativeIn | |||
## Remarks | |||
In .NET Core 3.0 and later, values that are too large to represent are rounded to <xref:System.Double.PositiveInfinity> or <xref:System.Double.NegativeInfinity> as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. | |||
|
|||
The `s` parameter can contain the current culture's <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A?displayProperty=nameWithType>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A?displayProperty=nameWithType>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A?displayProperty=nameWithType>, or a string of the form: | |||
The `s` parameter can contain the current culture's <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A?displayProperty=nameWithType>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A?displayProperty=nameWithType>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A?displayProperty=nameWithType> (the string comparison is case-insensitive in .NET Core 3.0 and later, but is case-sensitive in prior versions including .NET Framework), or a string of the form: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `s` parameter can contain the current culture's <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A?displayProperty=nameWithType>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A?displayProperty=nameWithType>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A?displayProperty=nameWithType> (the string comparison is case-insensitive in .NET Core 3.0 and later, but is case-sensitive in prior versions including .NET Framework), or a string of the form: | |
The `s` parameter can contain the current culture's <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A?displayProperty=nameWithType>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A?displayProperty=nameWithType>, or <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A?displayProperty=nameWithType> symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: |
Summary
The
Single.Parse
,Single.TryParse
,Double.Parse
, andDouble.TryParse
methods are case-insensitive in .NET Core 3.0 and later, when parsing string representations ofPositiveInfinity
,NegativeInfinity
, andNaN
.References