Skip to content

Commit

Permalink
fix type unstable Uniform
Browse files Browse the repository at this point in the history
  • Loading branch information
prbzrg committed Nov 6, 2023
1 parent 7e232ca commit 8cb7c5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/univariate/continuous/uniform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Base.:*(c::Real, d::Uniform) = Uniform(minmax(c * d.a, c * d.b)...)

#### Sampling

rand(rng::AbstractRNG, d::Uniform) = d.a + (d.b - d.a) * rand(rng)
rand(rng::AbstractRNG, d::Uniform{T}) where {T<:Real} = d.a + (d.b - d.a) * rand(rng, T)

_rand!(rng::AbstractRNG, d::Uniform, A::AbstractArray{<:Real}) =
A .= quantile.(d, rand!(rng, A))
Expand Down

0 comments on commit 8cb7c5b

Please sign in to comment.