-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Math.xml samples -- updating for Try .NET #1875
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
Conversation
|
||
public class Example | ||
{ | ||
public static void Main() | ||
{ | ||
// <Snippet1> | ||
decimal[] decimals = { Decimal.MaxValue, 12.45M, 0M, -19.69M, | ||
Decimal.MinValue }; | ||
foreach (decimal value in decimals) | ||
Console.WriteLine("Abs({0}) = {1}", value, Math.Abs(value)); |
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.
You may check if there are other places where string interpolation can be used.
Console.WriteLine("Abs({0}) = {1}", value, Math.Abs(value)); | |
Console.WriteLine($"Abs({value}) = {Math.Abs(value)}"); |
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 set of changes is optional, but highly recommended.
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 instance is fixed -- looking for others now.
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.
@BillWagner, @Youssef1313 -- there are 13 more such constructs in this set of example files; working on them.
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.
Thanks for doing all this work @WilliamAntonRohm
I've added a couple comments that we should address before merging this one.
|
||
public class Example | ||
{ | ||
public static void Main() | ||
{ | ||
// <Snippet1> | ||
decimal[] decimals = { Decimal.MaxValue, 12.45M, 0M, -19.69M, | ||
Decimal.MinValue }; | ||
foreach (decimal value in decimals) | ||
Console.WriteLine("Abs({0}) = {1}", value, Math.Abs(value)); |
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 set of changes is optional, but highly recommended.
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.
(not sure why GitHub started a review on my behalf)
@BillWagner, @Youssef1313 -- I've updated 11 of the 13 remaining occurrences. Those two seem simpler as-is: max.cs
min.cs likewise. |
I added an additional "Jody" per issue dotnet/dotnet-api-docs#1875 to demonstrate how the sorting function handles duplicate values, and updated the sample unsorted and sorted output to demonstrate how the duplication is handled.
docs PR is dotnet/dotnet-api-docs#3731