You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> using Symbolics
julia> @variables x
1-element Vector{Num}:
x
julia> invoke(binomial, Tuple{Number, Integer}, x, 3) # this is what I would expect from `binomial(x, 3)`
(1//6)*x*(x - 1)*(x - 2)
julia> binomial(x, 3) # instead there's a `MethodError`
ERROR: MethodError: binomial(::Num, ::Int64) is ambiguous.
Candidates:
binomial(arg1::Num, arg2::Real)
@ Symbolics ~/.julia/packages/Symbolics/BQlmn/src/register.jl:55
binomial(x::Number, k::Integer)
@ Base intfuncs.jl:1145
Possible fix, define
binomial(::Num, ::Integer)
Stacktrace:
[1] top-level scope
@ REPL[4]:1
(@v1.11) pkg> st Symbolics
Status `~/.julia/environments/v1.11/Project.toml`
[0c5d862f] Symbolics v5.5.1
The behavior of binomial(x, 3) changed recently, I guess because of #985:
julia> using Symbolics
julia> @variables x
1-element Vector{Num}:
x
julia> invoke(binomial, Tuple{Number, Integer}, x, 3)
(1//6)*(-2 + x)*(-1 + x)*x
julia> binomial(x, 3)
binomial(x, 3)
(@v1.11) pkg> st Symbolics
Status `~/.julia/environments/v1.11/Project.toml`
[0c5d862f] Symbolics v5.10.0
So the error is gone, but I don't see how the result is useful. @YingboMa how to get the result as expected (a polynomial, as in the invoke) from the result of a call like binomial(x, 3)?
As first noted by stevengj on Discourse.
The text was updated successfully, but these errors were encountered: