-
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
Open
PopSlime
wants to merge
1
commit into
dotnet:main
Choose a base branch
from
PopSlime:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
[*ws*][*sign*][*integral-digits*[*,*]]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] | ||||||
|
||||||
|
@@ -5020,7 +5020,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and | |||||
|
||||||
- <xref:System.Globalization.NumberStyles.HexNumber> | ||||||
|
||||||
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>. Depending on the value of `style`, it can also take 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> (the string comparison is case-insensitive in .NET Core 3.0 and later, but is case-sensitive in prior versions including .NET Framework). Depending on the value of `style`, it can also take the form: | ||||||
|
||||||
[*ws*][*$*][*sign*][*integral-digits*[*,*]]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] | ||||||
|
||||||
|
@@ -5168,7 +5168,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and | |||||
|
||||||
This overload of the <xref:System.Double.Parse%28System.String%2CSystem.IFormatProvider%29> method is typically used to convert text that can be formatted in a variety of ways to a <xref:System.Double> value. For example, it can be used to convert the text that is entered by a user into an HTML text box to a numeric value. | ||||||
|
||||||
The `s` parameter is interpreted using a combination of the <xref:System.Globalization.NumberStyles.Float?displayProperty=nameWithType> and <xref:System.Globalization.NumberStyles.AllowThousands?displayProperty=nameWithType> flags. The `s` parameter can contain <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> for the culture specified by `provider`, or it can contain a string of the form: | ||||||
The `s` parameter is interpreted using a combination of the <xref:System.Globalization.NumberStyles.Float?displayProperty=nameWithType> and <xref:System.Globalization.NumberStyles.AllowThousands?displayProperty=nameWithType> flags. The `s` parameter can contain <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> for the culture specified by `provider` (the string comparison is case-insensitive in .NET Core 3.0 and later, but is case-sensitive in prior versions including .NET Framework), or it can contain a string of the form: | ||||||
|
||||||
[*ws*][*sign*]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] | ||||||
|
||||||
|
@@ -5409,7 +5409,7 @@ If `s` is out of range of the <xref:System.Double> data type, the method returns | |||||
|
||||||
- <xref:System.Globalization.NumberStyles.HexNumber> | ||||||
|
||||||
The `s` parameter can contain <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> for the culture specified by `provider`. Depending on the value of `style`, it can also take the form: | ||||||
The `s` parameter can contain <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> for the culture specified by `provider` (the string comparison is case-insensitive in .NET Core 3.0 and later, but is case-sensitive in prior versions including .NET Framework). Depending on the value of `style`, it can also take the form: | ||||||
|
||||||
[*ws*] [*$*] [*sign*][*integral-digits*,]*integral-digits*[.[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] | ||||||
|
||||||
|
@@ -9313,7 +9313,7 @@ Tau is approximately 6.2831853071795864769. | |||||
|A specific format or precision|Default (current) culture|<xref:System.Double.ToString%28System.String%29>| | ||||||
|A specific format or precision|A specific culture|<xref:System.Double.ToString%28System.String%2CSystem.IFormatProvider%29>| | ||||||
|
||||||
The return value can be <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A>, or a string of the form: | ||||||
The return value can be <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A> (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: | ||||||
|
||||||
[sign]integral-digits[.[fractional-digits]][E[sign]exponential-digits] | ||||||
|
||||||
|
@@ -9435,7 +9435,7 @@ Tau is approximately 6.2831853071795864769. | |||||
|A specific format or precision|Default (current) culture|<xref:System.Double.ToString%28System.String%29>| | ||||||
|A specific format or precision|A specific culture|<xref:System.Double.ToString%28System.String%2CSystem.IFormatProvider%29>| | ||||||
|
||||||
The return value can be <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A>, or a string of the form: | ||||||
The return value can be <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A> (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: | ||||||
|
||||||
[sign]integral-digits[.[fractional-digits]][E[sign]exponential-digits] | ||||||
|
||||||
|
@@ -9560,7 +9560,7 @@ Tau is approximately 6.2831853071795864769. | |||||
|Default ("G") format|A specific culture|<xref:System.Double.ToString%28System.IFormatProvider%29>| | ||||||
|A specific format or precision|A specific culture|<xref:System.Double.ToString%28System.String%2CSystem.IFormatProvider%29>| | ||||||
|
||||||
The return value can be <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A>, or the string representation of a number, as specified by `format`. | ||||||
The return value can be <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A> (the string comparison is case-insensitive in .NET Core 3.0 and later, but is case-sensitive in prior versions including .NET Framework), or the string representation of a number, as specified by `format`. | ||||||
|
||||||
The `format` parameter can be any valid standard numeric format specifier except for D and X, as well as any combination of custom numeric format specifiers. If `format` is `null` or an empty string, the return value is formatted with the general numeric format specifier ("G"). | ||||||
|
||||||
|
@@ -9682,7 +9682,7 @@ Tau is approximately 6.2831853071795864769. | |||||
|Default ("G") format|A specific culture|<xref:System.Double.ToString%28System.IFormatProvider%29>| | ||||||
|A specific format or precision|Default (current) culture|<xref:System.Double.ToString%28System.String%29>| | ||||||
|
||||||
The return value can be <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A>, or the string representation of a number, as specified by `format`. | ||||||
The return value can be <xref:System.Globalization.NumberFormatInfo.PositiveInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NegativeInfinitySymbol%2A>, <xref:System.Globalization.NumberFormatInfo.NaNSymbol%2A> (the string comparison is case-insensitive in .NET Core 3.0 and later, but is case-sensitive in prior versions including .NET Framework), or the string representation of a number, as specified by `format`. | ||||||
|
||||||
The `format` parameter can be any valid standard numeric format specifier except for D and X, as well as any combination of custom numeric format specifiers. If `format` is `null` or an empty string, the return value for this instance is formatted with the general numeric format specifier ("G"). | ||||||
|
||||||
|
@@ -10055,7 +10055,7 @@ Tau is approximately 6.2831853071795864769. | |||||
|
||||||
This overload differs from the <xref:System.Double.Parse%28System.String%29?displayProperty=nameWithType> method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed numeric value. It eliminates the need to use exception handling to test for a <xref:System.FormatException> in the event that `s` is invalid and cannot be successfully parsed. | ||||||
|
||||||
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-sensitive), 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: | ||||||
|
||||||
[ws][sign][integral-digits,]integral-digits[.[fractional-digits]][e[sign]exponential-digits][ws] | ||||||
|
||||||
|
@@ -10431,7 +10431,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and | |||||
|
||||||
- <xref:System.Globalization.NumberStyles.HexNumber?displayProperty=nameWithType> | ||||||
|
||||||
The `s` parameter can contain <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> for the culture indicated by `provider`. In addition, depending on the value of `style`, the `s` parameter may include the following elements: | ||||||
The `s` parameter can contain <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> for the culture indicated by `provider` (the string comparison is case-insensitive in .NET Core 3.0 and later, but is case-sensitive in prior versions including .NET Framework). In addition, depending on the value of `style`, the `s` parameter may include the following elements: | ||||||
|
||||||
[ws] [$] [sign][integral-digits,]integral-digits[.fractional-digits][e[sign]exponential-digits][ws] | ||||||
|
||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.