-
Notifications
You must be signed in to change notification settings - Fork 419
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 divide by zero check to BigInteger mod #22774
Conversation
Signed-off-by: Jade Abraham <[email protected]>
these are used to implement mod operators with less code duplication Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
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 looks good to me. The one thing that I was thinking of that may make sense would be to use boundsChecking
, rather than chpl_checkDivByZero
, since that is what we typically use for module-level halts, but I think since this one is specifically divide by zero checks, I feel fine with how you've gone here.
Removes almost all of the remaining BigInteger deprecations This PR removes the deprecations from the following PRs I authored - #22775 - #22888/#22774 - #22818 - #22794 - #22788 - #22121 I also removed the remaining deprecations done by Yash Raj - #18855 - #18827 I moved one test out of the deprecated/BigInteger directory, `bigint_getlimbs.chpl`, since its not a deprecation test and actually checks functionality. Testing - [x] paratest without comm - [x] paratest with comm - [x] built docs and checked them [Reviewed by @ShreyasKhandekar]
Adds a divide by zero check to
BigInteger.mod
,BigInteger.%
andBigInteger.%=
to match the divide functions (#19384). While doing this work, implemented part of the change for argument names (#19005 (comment)).Summary of changes
mod
mod
in terms of thedivR
with the proper rounding argumentmodTrunc
by aintegral
to reduce code duplicationa
/b
onmod
in favor ofx
/y
New tests
test/library/standard/BigInteger/modByZero.chpl
test/deprecated/BigInteger/argumentNames.chpl
Testing
[Reviewed by @bmcdonald3]
closes #19384
closes cray/chapel-private#5094