Skip to content

Commit

Permalink
src/Deprecations.jl: remove obsolete code (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Dec 22, 2023
1 parent 2c26c7a commit 6aeaa90
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions src/Deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,51 +138,7 @@
# Things that moved to Nemo

# > 0.18.1
if isdefined(Nemo, :simplest_between)
simplest_inside(x::arb) = simplest_rational_inside(x)
else
function _fmpq_simplest_between(l_num::ZZRingElem, l_den::ZZRingElem,
r_num::ZZRingElem, r_den::ZZRingElem)
n = ZZRingElem()
d = ZZRingElem()

ccall((:_fmpq_simplest_between, libflint), Nothing,
(Ref{ZZRingElem}, Ref{ZZRingElem}, Ref{ZZRingElem}, Ref{ZZRingElem}, Ref{ZZRingElem}, Ref{ZZRingElem}),
n, d, l_num, l_den, r_num, r_den)

return n//d
end

@doc raw"""
simplest_between(l::QQFieldElem, r::QQFieldElem)
> Return the simplest fraction in the closed interval `[l, r]`. A canonical >
> fraction `a_1/b_1` is defined to be simpler than `a_2/b_2` iff `b_1 < b_2` or
> `b_1 = b_2` and `a_1 < a_2`.
"""
function simplest_between(l::QQFieldElem, r::QQFieldElem)
z = QQFieldElem()
ccall((:fmpq_simplest_between, libflint), Nothing,
(Ref{QQFieldElem}, Ref{QQFieldElem}, Ref{QQFieldElem}), z, l, r)
return z
end

function simplest_inside(x::arb)
a = ZZRingElem()
b = ZZRingElem()
e = ZZRingElem()

ccall((:arb_get_interval_fmpz_2exp, libarb), Nothing, (Ref{ZZRingElem}, Ref{ZZRingElem}, Ref{ZZRingElem}, Ref{arb}), a, b, e, x)
@assert fits(Int, e)
_e = Int(e)
if e >= 0
return a << _e
end
_e = -_e
d = one(ZZRingElem) << _e
return _fmpq_simplest_between(a, d, b, d)
end
end
simplest_inside(x::arb) = simplest_rational_inside(x)

# Deprecated during 0.18.*

Expand Down

0 comments on commit 6aeaa90

Please sign in to comment.