Skip to content

Commit fe710c8

Browse files
committed
Use VERSION check for isone
1 parent 47ee3b8 commit fe710c8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/show.jl

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ function show(io::IO, v::AbstractVariable)
22
print(io, name(v))
33
end
44

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

89
function show(io::IO, m::AbstractMonomial)
910
if isconstant(m)
@@ -12,7 +13,7 @@ function show(io::IO, m::AbstractMonomial)
1213
for (var, exp) in zip(variables(m), exponents(m))
1314
if !iszero(exp)
1415
print(io, var)
15-
if !_isone(exp)
16+
if !isone(exp)
1617
print(io, "^", exp)
1718
end
1819
end
@@ -24,7 +25,7 @@ function Base.show(io::IO, t::AbstractTerm)
2425
if isconstant(t)
2526
print(io, coefficient(t))
2627
else
27-
if !_isone(coefficient(t))
28+
if !isone(coefficient(t))
2829
print(io, coefficient(t))
2930
end
3031
if !iszero(t)

0 commit comments

Comments
 (0)