Skip to content

Commit

Permalink
Add missing return value in divexact! methods
Browse files Browse the repository at this point in the history
Also simplify a divexact method
  • Loading branch information
fingolfin committed Sep 20, 2024
1 parent 59d6a4f commit 507e148
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/HeckeMoreStuff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ function divexact!(A::Generic.Mat{AbsSimpleNumFieldElem}, p::ZZRingElem)
A[i, j] = A[i, j] // p
end
end
return A

Check warning on line 886 in src/HeckeMoreStuff.jl

View check run for this annotation

Codecov / codecov/patch

src/HeckeMoreStuff.jl#L886

Added line #L886 was not covered by tests
end

#
Expand Down
8 changes: 2 additions & 6 deletions src/flint/fmpz_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -555,18 +555,14 @@ function divexact(x::ZZMatrix, y::Int; check::Bool=true)
return z
end

function divexact(x::ZZMatrix, y::ZZRingElem; check::Bool=true)
z = similar(x)
ccall((:fmpz_mat_scalar_divexact_fmpz, libflint), Nothing,
(Ref{ZZMatrix}, Ref{ZZMatrix}, Ref{ZZRingElem}), z, x, y)
return z
end
divexact(x::ZZMatrix, y::ZZRingElem; check::Bool=true) = divexact!(similar(x), x, y)

divexact(x::ZZMatrix, y::Integer; check::Bool=true) = divexact(x, ZZRingElem(y); check=check)

function divexact!(a::ZZMatrix, b::ZZMatrix, d::ZZRingElem)
ccall((:fmpz_mat_scalar_divexact_fmpz, libflint), Nothing,
(Ref{ZZMatrix}, Ref{ZZMatrix}, Ref{ZZRingElem}), a, b, d)
return a
end

###############################################################################
Expand Down

0 comments on commit 507e148

Please sign in to comment.