Skip to content

[css-values-5] How should random() handle extremely large ranges / extremely tiny steps? #11634

Closed
@weinig

Description

@weinig

The definition of the CSS random() function (https://drafts.csswg.org/css-values-5/#randomness) could use clarification on the expected math for computing a uniform distribution for ranges where for finite (but very large) max - min overflows and equals infinity. A naive implementation (or one that is using say, the C++ standard library's std::uniform_real_distribution) returns infinity for all cases here, but additional work could make this work if that is desired.

A similar problem arises for sufficiently tiny step values.

For all other math functions defined by calc, there have been clear IEEE-754 semantics to follow, or explicit algorithms (as with progress()). Given the new territory here, it would be useful to be specific in the requirements.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions