Skip to content

Random sample from LogNormal does not return values of the same type as its parameters #1970

@itsdfish

Description

@itsdfish

Hello,

I noticed that rand does not return the same type as the parameters in LogNormal. For example,

julia> rand(Normal(0f0, 1f0)) |> typeof
Float32

julia> rand(Gamma(1f0, 1f0)) |> typeof
Float32

julia> rand(LogNormal(0f0, 1f0)) |> typeof
Float64

The types for Gamma and Normal agree, but rand returns Float64 for LogNormal.

Version Info

[31c24e10] Distributions v0.25.118
Julia 1.11.5

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