> Greetings internals,
>
> I present to you a proposal for a new basic math function: clamp.
>
> The main goal of this function is to contain a number inside a given bound.
> And return the number if it is inside of that bound, and if not, and the
> number is outside of the given bound, the
Hi Kim
> I present to you a proposal for a new basic math function: clamp.
> ...
> What are your opinions on this function?
I for one think this is a good candidate for PHPs standard library.
It's simple, unopinionated and standardized in other languages. Even
though it's simple to implement in
Le 23/06/2021 à 10:28, Lynn a écrit :
On Wed, Jun 23, 2021 at 3:07 AM Marco Pivetta wrote:
The problem is exactly the fact that it is trivial to implement in
userland: why not do it there instead?
My 2cents: because people won't use it when the barrier is too high to get
it. There are a ton
On Wed, Jun 23, 2021 at 3:07 AM Marco Pivetta wrote:
> The problem is exactly the fact that it is trivial to implement in
> userland: why not do it there instead?
>
My 2cents: because people won't use it when the barrier is too high to get
it. There are a ton of great libraries that have
Hey Kim
On Wed, Jun 23, 2021, 02:25 Kim Hallberg wrote:
> This function is very easy to implement, has no side effects or backward
> compatibility issues, unless a userland implementation already has the
> function declared,
>
I like the function, the name, and its simplicity.
The problem is
Greetings internals,
I present to you a proposal for a new basic math function: clamp.
The main goal of this function is to contain a number inside a given bound.
And return the number if it is inside of that bound, and if not, and the
number is outside of the given bound, the nearest bound is