Skip to content

Added exceptions that DivRem raises#12354

Open
andanteyk wants to merge 4 commits intodotnet:mainfrom
andanteyk:divrem
Open

Added exceptions that DivRem raises#12354
andanteyk wants to merge 4 commits intodotnet:mainfrom
andanteyk:divrem

Conversation

@andanteyk
Copy link

Summary

Added exceptions (especially OverflowException) that Math.DivRem or Int***.DivRem raise.

From dotnet/runtime#124932

@andanteyk andanteyk requested a review from a team as a code owner February 27, 2026 04:43
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 27, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime

@tannergooding
Copy link
Member

Could you update the unsigned integer ones to include the DivideByZeroException as well?

Would probably also be good to cover BigInteger and IBinaryInteger, but otherwise changes LGTM

<remarks>To be added.</remarks>
<inheritdoc cref="M:System.Numerics.IBinaryInteger`1.DivRem(`0,`0)" />
<exception cref="T:System.DivideByZeroException">
<paramref name="right" /> is zero.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<paramref name="right" /> is zero.</exception>
<paramref name="right" /> is 0.</exception>

@tannergooding Wouldn't 0 be better than zero here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no preference. There are times where I think zero is more readable and others where I think 0 is instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Runtime community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants