Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
weinig opened this issue Feb 2, 2025 · 0 comments

Comments

@weinig
Copy link
Contributor

weinig commented Feb 2, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants