Skip to content
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

Small fix of is_divisible (and divexact) + tests #1713

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

SirToby25
Copy link
Contributor

Given an instance A of a subtype of Hecke.AbstractAssociativeAlgebra{T}, trying

divexact(zero(A), zero(A))

would result in a BoundsError instead of the usual ErrorException, due to r == 0 in the Elem.jl.

This commit fixes this an also adds two small tests.

@thofma
Copy link
Owner

thofma commented Dec 27, 2024

Hm, I think the answer for is_divisible(zero(A), zero(A)) should be true and divexact(zero(A), zero(A)) should not throw.

Copy link

codecov bot commented Dec 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.99%. Comparing base (83f49f5) to head (6f53a9b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1713      +/-   ##
==========================================
- Coverage   76.03%   75.99%   -0.05%     
==========================================
  Files         361      361              
  Lines      114377   114377              
==========================================
- Hits        86963    86917      -46     
- Misses      27414    27460      +46     
Files with missing lines Coverage Δ
src/AlgAss/Elem.jl 88.65% <100.00%> (+0.29%) ⬆️

... and 29 files with indirect coverage changes

@SirToby25
Copy link
Contributor Author

I agree that is_divisible(zero(A), zero(A)) should return true.

However, the following already throw a DivideError, so I think divexact(zero(A), zero(A)) throwing would be preferable for consistency.

divexact(zero(ZZ), zero(ZZ))
divexact(zero(QQ), zero(QQ))

@thofma thofma merged commit 0ce416c into thofma:master Dec 27, 2024
17 checks passed
@thofma
Copy link
Owner

thofma commented Dec 27, 2024

Right, let's keep it consistent for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants