I'm writing such a method library. I can't seem to find a good name for it nor any reference of anyone having named such a function before.
What would be a good name for it?
I'm writing such a method library. I can't seem to find a good name for it nor any reference of anyone having named such a function before.
What would be a good name for it?
I would call it a clipper as a noun and clip as a verb.
The operation you're describing would be a NegativeClip or SubzeroClip. Of course you could just have a generic function with two or three arguments. Depending on your needs I could see LowerBoundClip or FloorClip or BottomClip being paired with UpperBoundClip or CeilingClip or TopClip instead. In a couple of those the word clip almost sounds redundant.
Words like bound, bounds, bounded, boundary are used in mathematics but as I think about possible function names I'm not sure they were as clear in meaning. And binding is already used in other programming topics so there's some potential for confusion that also.