-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
In many method definitions arguments are typed as Number. For example, in src/distrs/chisq.jl
# pdf for numbers with generic types
function chisqpdf(k::Real, x::Number)
hk = k / 2 # half k
1 / (2^(hk) * gamma(hk)) * x^(hk - 1) * exp(-x / 2)
end
# logpdf for numbers with generic types
function chisqlogpdf(k::Real, x::Number)
hk = k / 2 # half k
-hk * log(oftype(hk, 2)) - lgamma(hk) + (hk - 1) * log(x) - x / 2
endIt appears that the only difference between Number and Real is that Number includes Complex
julia> subtypes(Number)
2-element Array{Union{DataType, UnionAll},1}:
Complex
Real I don't see the purpose in allowing complex numbers in these cases. Any objection to my changing these to Real?
Metadata
Metadata
Assignees
Labels
No labels