Skip to content

Commit ea47a94

Browse files
committed
2 parents 439d21b + e3a7f6c commit ea47a94

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/arithmetic.jl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ function -(d1::U, d2::U) where U <: SingletonOrArray
3333
return UnivariateFinite(L, pdf_matrix(d1, L) - pdf_matrix(d2, L))
3434
end
3535

36-
# It seems that the restriction `x::Number` below (applying only to the
37-
# array case) is unavoidable because of a method ambiguity with
38-
# `Base.*(::AbstractArray, ::Number)`.
39-
4036
function _times(d, x, T)
4137
S = d.scitype
4238
decoder = d.decoder
@@ -46,10 +42,10 @@ function _times(d, x, T)
4642
end
4743
return T(d.scitype, decoder, prob_given_ref)
4844
end
49-
*(d::UnivariateFinite, x) = _times(d, x, UnivariateFinite)
45+
*(d::UnivariateFinite, x::Number) = _times(d, x, UnivariateFinite)
5046
*(d::UnivariateFiniteArray, x::Number) = _times(d, x, UnivariateFiniteArray)
5147

52-
*(x, d::UnivariateFinite) = d*x
48+
*(x::Number, d::UnivariateFinite) = d*x
5349
*(x::Number, d::UnivariateFiniteArray) = d*x
54-
/(d::UnivariateFinite, x) = d*inv(x)
50+
/(d::UnivariateFinite, x::Number) = d*inv(x)
5551
/(d::UnivariateFiniteArray, x::Number) = d*inv(x)

0 commit comments

Comments
 (0)