-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update Complex.ToString to reflect formatting in .NET 8+ #10125
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
Update Complex.ToString to reflect formatting in .NET 8+ #10125
Conversation
Per dotnet/docs#41835, the format from Complex.ToString changed in .NET 8 from (a, b) to <a; b>
Tagging subscribers to this area: @dotnet/area-system-numerics |
Learn Build status updates of commit d4ca96f: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
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.
This LGTM. Let's
## Remarks | ||
The default string representation of a complex number displays the number using its Cartesian coordinates in the form `(`*a*`,` *b*`)`, where *a* is the real part of the complex number, and *b* is its imaginary part. Both *a* and *b* are formatted using the general format specifier ("G") and the conventions of the current system culture. | ||
The default string representation of a complex number displays the number using its Cartesian coordinates in the form `<`*a*`;` *b*`>`, where *a* is the real part of the complex number, and *b* is its imaginary part. Both *a* and *b* are formatted using the general format specifier ("G") and the conventions of the current system culture. |
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.
@jeffhandley It seems like we should keep the old and new syntax and annotate them with the versions they're applicable to.
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.
OK, I can send a follow up PR, @gewarren. Would the following wording be good? Please feel free to offer refinement to it.
The default string representation of a complex number displays the number using its Cartesian coordinates in the form `<`*a*`;` *b*`>`, where *a* is the real part of the complex number, and *b* is its imaginary part. Both *a* and *b* are formatted using the general format specifier ("G") and the conventions of the current system culture. | |
The default string representation of a complex number displays the number using its Cartesian coordinates in the form `<`*a*`;` *b*`>`, where *a* is the real part of the complex number, and *b* is its imaginary part. Both *a* and *b* are formatted using the general format specifier ("G") and the conventions of the current system culture. In .NET 7 and earlier, the form `(`*a*`, `*b*`)` was used. |
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 default string representation of a complex number displays the number using its Cartesian coordinates in the form `<`*a*`;` *b*`>`, where *a* is the real part of the complex number, and *b* is its imaginary part. Both *a* and *b* are formatted using the general format specifier ("G") and the conventions of the current system culture. | |
The default string representation of a complex number displays the number using its Cartesian coordinates in the form `<`*a*`;` *b*`>` (or `(`*a*`, `*b*`)` in .NET 7 and earlier versions), where *a* is the real part of the complex number, and *b* is its imaginary part. Both *a* and *b* are formatted using the general format specifier ("G") and the conventions of the current system culture. |
@jeffhandley This would be my recommended wording.
Per dotnet/docs#41835, the format from Complex.ToString changed in .NET 8 from
(a, b)
to<a; b>
.Summary
Fixes dotnet/runtime#93454