Skip to content

Commit

Permalink
Use VERSION check for isone
Browse files Browse the repository at this point in the history
  • Loading branch information
saschatimme committed Aug 15, 2017
1 parent 47ee3b8 commit fe710c8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ function show(io::IO, v::AbstractVariable)
print(io, name(v))
end


_isone(x::T) where T = x == one(T)
if VERSION < v"0.7.0-DEV.1319"
isone(x::T) where T = x == one(T)
end

function show(io::IO, m::AbstractMonomial)
if isconstant(m)
Expand All @@ -12,7 +13,7 @@ function show(io::IO, m::AbstractMonomial)
for (var, exp) in zip(variables(m), exponents(m))
if !iszero(exp)
print(io, var)
if !_isone(exp)
if !isone(exp)
print(io, "^", exp)
end
end
Expand All @@ -24,7 +25,7 @@ function Base.show(io::IO, t::AbstractTerm)
if isconstant(t)
print(io, coefficient(t))
else
if !_isone(coefficient(t))
if !isone(coefficient(t))
print(io, coefficient(t))
end
if !iszero(t)
Expand Down

0 comments on commit fe710c8

Please sign in to comment.