Skip to content

Commit

Permalink
Don't ccall fmpq_numerator_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 22, 2024
1 parent 569413b commit 4533873
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/flint/fmpq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -671,25 +671,25 @@ remove(a::QQFieldElem, b::Integer) = remove(a, ZZRingElem(b))
valuation(a::QQFieldElem, b::Integer) = valuation(a, ZZRingElem(b))

function remove!(a::QQFieldElem, b::ZZRingElem)
nr = ccall((:fmpq_numerator_ptr, libflint), Ptr{ZZRingElem}, (Ref{QQFieldElem},), a)
nr = _num_ptr(a)
vn, nr = remove!(nr, b)

Check warning on line 675 in src/flint/fmpq.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpq.jl#L674-L675

Added lines #L674 - L675 were not covered by tests
#QQFieldElem's are simplified: either num OR den will be non-trivial
if vn != 0
if !is_zero(vn)

Check warning on line 677 in src/flint/fmpq.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpq.jl#L677

Added line #L677 was not covered by tests
return vn, a
end
nr = ccall((:fmpq_denominator_ptr, libflint), Ptr{ZZRingElem}, (Ref{QQFieldElem},), a)
nr = _den_ptr(a)
vn, nr = remove!(nr, b)

Check warning on line 681 in src/flint/fmpq.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpq.jl#L680-L681

Added lines #L680 - L681 were not covered by tests
return -vn, a
end

function valuation!(a::QQFieldElem, b::ZZRingElem)
nr = ccall((:fmpq_numerator_ptr, libflint), Ptr{ZZRingElem}, (Ref{QQFieldElem},), a)
nr = _num_ptr(a)
vn, nr = remove!(nr, b)

Check warning on line 687 in src/flint/fmpq.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpq.jl#L686-L687

Added lines #L686 - L687 were not covered by tests
#QQFieldElem's are simplified: either num OR den will be non-trivial
if vn != 0
if !is_zero(vn)

Check warning on line 689 in src/flint/fmpq.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpq.jl#L689

Added line #L689 was not covered by tests
return vn
end
nr = ccall((:fmpq_denominator_ptr, libflint), Ptr{ZZRingElem}, (Ref{QQFieldElem},), a)
nr = _den_ptr(a)
vn, nr = remove!(nr, b)

Check warning on line 693 in src/flint/fmpq.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpq.jl#L692-L693

Added lines #L692 - L693 were not covered by tests
return -vn
end
Expand Down

0 comments on commit 4533873

Please sign in to comment.