Skip to content

Commit

Permalink
Blind guess at fixing type inference on 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Jun 29, 2024
1 parent c73a6e1 commit 70c7810
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/truncated/lognormal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# Given `truncate(LogNormal(μ, σ), a, b)`, return `truncate(Normal(μ, σ), log(a), log(b))`
function _truncnorm(d::Truncated{<:LogNormal})
μ, σ = params(d.untruncated)
T = partype(d)
T = float(partype(d))
a = d.lower === nothing || d.lower <= 0 ? nothing : log(T(d.lower))
b = d.upper === nothing || isinf(d.upper) ? nothing : log(T(d.upper))
return truncated(Normal(μ, σ), a, b)
return truncated(Normal{T}(T(μ), T(σ)), a, b)
end

mean(d::Truncated{<:LogNormal}) = mgf(_truncnorm(d), 1)
Expand Down

0 comments on commit 70c7810

Please sign in to comment.