Skip to content

Commit afef24c

Browse files
committed
Deprecate asintegerpoly
as mentioned in #259 (comment)
1 parent 522079d commit afef24c

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

src/common.jl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ export fromroots,
1616
integrate,
1717
derivative,
1818
variable,
19-
isintegerpoly,
20-
asintegerpoly
19+
isintegerpoly
2120

2221
"""
2322
fromroots(::AbstractVector{<:Number}; var=:x)
@@ -328,18 +327,8 @@ Base.real(p::AbstractPolynomial) = as_(real, p)
328327
isintegerpoly(p::AbstractPolynomial)
329328
330329
Determine whether a polynomial is an integer polynomial, i.e., having only integers as coefficients.
331-
332-
See also: [`asintegerpoly`](@ref)
333330
"""
334331
isintegerpoly(p::AbstractPolynomial) = is_(isinteger, p)
335-
"""
336-
asintegerpoly(p::AbstractPolynomial)
337-
338-
Construct an integer polynomial from the coefficients of `p`.
339-
340-
See also: [`isintegerpoly`](@ref)
341-
"""
342-
asintegerpoly(p::AbstractPolynomial) = as_(x -> convert(Integer, x), p)
343332

344333
"""
345334
coeffs(::AbstractPolynomial)

test/Poly.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,13 @@ fit(Poly, xx,yy,2)
432432
@test real(y) == real(x)
433433
end
434434

435-
@testset "`isintegerpoly` and `asintegerpoly`" begin
435+
@testset "`isintegerpoly`" begin
436436
x = Polynomial([1 // 1, Int8(2) + 0im, 3.0, Int16(4) + 0im])
437437
y = Polynomial([1 // 2, Int8(2) + 0im, 3.0, Int16(4) + 0im])
438438
@test isintegerpoly(x) === true
439-
@test eltype(asintegerpoly(x)) === Int
440-
@test asintegerpoly(x) == Polynomial([1, 2, 3, 4])
441439
@test isintegerpoly(y) === false
442-
@test_throws InexactError asintegerpoly(y)
440+
@test convert(Polynomial{Int}, x) == Polynomial([1, 2, 3, 4])
441+
@test_throws InexactError convert(Polynomial{Int}, y)
443442
end
444443

445444

0 commit comments

Comments
 (0)