Skip to content

Type instability whenever calling randexp #1527

@enweg

Description

@enweg

rand(rng::AbstractRNG, d::Exponential) = xval(d, randexp(rng))

I have noticed that even when declaring Gamma, Exponential and similar distributions to be of type Float32, sampling always returns a Float64. Not sure if this is intentional or not, but it seems to be easily fixed by always calling randexp(rng, T) with T being the type of the parameters of the distribution.

Would be interested to know if this was intentional? It does not seem like it to me given that rand will return Float32 for gaussians of type Float32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions