We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e290d0 commit f876e6bCopy full SHA for f876e6b
src/mono.jl
@@ -28,8 +28,11 @@ function Monomial{C}(α) where C
28
α == 1 || error("Cannot convert $α to a Monomial{$C} as it is not one")
29
Monomial{C}(PolyVar{C}[], Int[])
30
end
31
-# defaults to commutative so that `Monomial(1)` is consistent with TypedPolynomials
32
-Monomial(α) = Monomial{true}(α)
+
+@static if VERSION ≥ v"0.7-"
33
+ # defaults to commutative so that `Monomial(1)` is consistent with TypedPolynomials
34
+ Monomial(α::Number) = Monomial{true}(α)
35
+end
36
37
Base.copy(m::M) where {M<:Monomial} = M(m.vars, copy(m.z))
38
0 commit comments