-
Notifications
You must be signed in to change notification settings - Fork 162
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
Updating the generic math design doc to account for additional changes #262
Updating the generic math design doc to account for additional changes #262
Conversation
…own to IFloatingPoint
…ve DIM annotations
I'd recommend reviewing the doc "as a whole", rather than only looking at the changes in this PR. Noting this is also not "complete" and will build up some more changes (several APIs need to move down to INumberBase still) before the API review on May 10th |
…er down to INumber
return y; | ||
} | ||
|
||
public static virtual TSelf MaxMagnitudeNumber(TSelf x, TSelf y) |
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.
FYI. @stephentoub that this includes the changes necessary for LINQ Min/Max.
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 read through the file and skimmed the code parts. I really like the "Scenarios" section. Seems like there is more to do but your additions in this PR look mostly mechanical. Out of curiosity, when you make updates like this, are you copy pasting code into this file, or is it auto generated somehow?
Couple spelling mistakes I happened to spot:
"...Jeff is trying to compute the standard deviation of a list of numbers. They are surprised to find that such a function isn't built into .NET. After searching the web, Jeff finds a blog post with the following method..."
- Change "they" to "he" to be consistent with later pronouns, I think.
"…that allow Jeff to implement the desired method without requiring users types to take a dependency on types they…"
- Add a ' after "users"?
"we need to strike a balance between expressiveness, exxtensibility, and cost."
- Typo: "exxtensibility"
…nd `MinMagnitudeNumber` down to INumberBase
|
Will update the design doc according to the feedback to ensure it stays up to date/correct and then will merge |
…turating, and ConvertTruncating
Updated doc according to the feedback. Noting that that the |
@tannergooding So the name ‘epsilon’ is used for a crucial constant that has a different value in most numerical algorithm settings than in the .NET CLR. It's not easy to discover this difference and it may have significant impact in an algorithm. Obviously one can’t go back to fix this 'mistake' in the .NET BCL, but the numerical interfaces seem like a good opportunity to help mitigate this issue a bit. One question might relate to the naming – it would be nice to have a name that points in the right direction, yet is easy to discover in a member list, e.g. if it starts with ‘Epsilon’ as the prefix. |
This namely covers usage of DIMs and gives additional sample code showing how DIMs might be used in various functions. This helps show the layering is "sound" and gives some examples of how future changes might be implemented when that becomes relevant.