-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add Tuple-based Math.DivRem overloads #45074
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. |
Tagging subscribers to this area: @tannergooding, @pgovind, @jeffhandley Issue DetailsThis PR adds
|
I think we are going to look at an analyzer. I don't know if hiding them is the correct approach, especially for users with muscle memory.
Yes.
I think its probably worth having long term. I'm sure there is a lot of code that doesn't use |
Yes. This was discussed extensively in the past and this was the conclusion: #27939 (comment) |
Someday we'll have better generics 🙃 |
I wonder if we should add |
Yes, I think it would be fine to add AggressiveInlining to all these methods. |
src/libraries/System.Private.CoreLib/src/System/Buffers/StandardFormat.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Number.BigInteger.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Stephen Toub <stoub@microsoft.com>
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.
Thank you!
This PR adds
Math.DivRem
APIs approved in #42156 (comment)out int result
being actually a remainder.idiv
since there is a good example by @CarolEidt Support mulx returning ValueTuple #37928 (furthermore, we can teach the JIT to recognize a sort ofGT_DIVREM
anywhere now) - do you think it's worth the effort? It was the main reason I decided to add these APIs actually 🙂)