Skip to content

randomR could produce NaNs when the upper bound is infinity #54

Closed
@shaobo-he

Description

@shaobo-he

When the upper bound is infinity, NaNs could be produced. For example,

filter (\x-> x/= (1/0)) $ randomRs ((0::Float), 1/0) $ mkStdGen 0
[NaN,NaN,NaN

Although it's unclear what should be produced when the upper bound is infinity, I don't think NaNs should be there anyways.

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