-
Notifications
You must be signed in to change notification settings - Fork 5k
[release/7.0-preview5] Refactoring the generic-math CreateChecked/Saturating/Truncating APIs to match API review #70034
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
[release/7.0-preview5] Refactoring the generic-math CreateChecked/Saturating/Truncating APIs to match API review #70034
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Corresponds to #64717 that I somehow missed, despite commenting on it. We still don't allow interfaces to implement methods of other interfaces. The CLR VM doesn't allow either.
CC. @jeffhandley |
This was approved over email |
Failures are unrelated. |
Backport of #69756 and #69783 to release/7.0-preview5
/cc @tannergooding
Customer Impact
Generic Math is one of the bigger features for .NET 7 and this ensures that users can successfully create any of the built-in numeric types from any of the other built-in numeric types. Not having this change means that users need to wait another preview to validate the generic math feature including all the taken community feedback and updates given so far. The types covered by the create APIs are:
The 13 "runtime primitives":
byte
,sbyte
short
,ushort
int
,uint
long
,ulong
nint
,nuint
float
,double
char
The 5 "user-defined" types in corelib:
Int128
,UInt128
decimal
Half
NFloat
There are then 2 more "user-defined" types outside corelib:
BigInteger
Complex
Testing
This has tests covering the conversions from any
T
to anyU
for the various edge cases in both directions.Risk
Minimal, this touches a preview and is only available for use via new APIs.