We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normally, if I type in something like
Normal{Float32}(0,1)
based on the default behaviour of constructors, I would expect a response similar to
Normal{Float32}(μ=0.0f0, σ=1.0f0)
where the parameters get converted to the appropriate type. However, instead, I get the following error:
ERROR: MethodError: no method matching Normal{Float32}(::Float64, ::Float64)
When looking at the source code, I see that the default constructor is overwritten:
struct Normal{T<:Real} <: ContinuousUnivariateDistribution μ::T σ::T Normal{T}(µ::T, σ::T) where {T<:Real} = new{T}(µ, σ) end
Is there any reason why the default constructor is so specific that the input values MUST be the same type as the constructor's parameter?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Normally, if I type in something like
based on the default behaviour of constructors, I would expect a response similar to
where the parameters get converted to the appropriate type. However, instead, I get the following error:
When looking at the source code, I see that the default constructor is overwritten:
Is there any reason why the default constructor is so specific that the input values MUST be the same type as the constructor's parameter?
The text was updated successfully, but these errors were encountered: