- From: Lukas Waslowski via GitHub <sysbot+gh@w3.org>
- Date: Wed, 08 Jan 2025 22:02:31 +0000
- To: public-css-archive@w3.org
These functions share nothing but one conceptual similarity: They are about one value that sits (or chooses) "between" two bounds, in some way or another. Argument order is always an arbitrary choice anyways... but on a general level, it's easier to remember the more consistent it is, as opposed to being `bound,value,bound` for one set of functions, and `value,bound,bound` for another. Even if what that "bound" specifically means is different. Though arguably CSS' `clamp()` with `bound,value,bound` is the odd one out hered, given that the corresponding functions in [C++](https://en.cppreference.com/w/cpp/algorithm/clamp), [Java](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Math.html#clamp(long,long,long)), [.NET](https://learn.microsoft.com/en-us/dotnet/api/system.math.clamp), [Ruby](https://apidock.com/ruby/Comparable/clamp) [^1] and anything else I could find all use `value,bound,bound`. [^1]: Sidenote: Haskell, Erlang, PHP & Perl do not seem to have a built-in `clamp` function. -- GitHub Notification of comment by cr7pt0gr4ph7 Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11427#issuecomment-2578752169 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 8 January 2025 22:02:32 UTC