0

Let's say I want to saturate an argument number x to a lower-bound value lb if it is lower than lb and otherwise return x itself. Then I can use max(lb, x). Analogously, I can use min(x, ub) if I have an upper bound ub.

Is there a function f, such that if I write f(lb, x, ub), one understands that the return value is the respective one?

  • lb, if x < lb;
  • ub, if x > ub; and
  • x, otherwise.

Or other notation simpler than writing max(lb, min(x, ub)).

FxMySz
  • 45
  • 1
    Some of the references to this question, https://math.stackexchange.com/questions/1336636/is-clamp-a-formally-recognized-mathematical-function , may give useful notation. It's unlikely to be a well-known notation, so you should define it in any work where you use it. – Eric Towers Feb 22 '24 at 04:57
  • Thank you @EricTowers. I really appreciated the references. Do you think my question should be flagged as a duplicate of the one you referred to? – FxMySz Feb 22 '24 at 05:09
  • It's not exactly a duplicate. There may be an exact duplicate ... somewhere. – Eric Towers Feb 22 '24 at 05:11
  • Found the duplicate: https://math.stackexchange.com/questions/3990111. So, I just flagged this question as a duplicate. I didn't find the duplicate before writing the question. But I found it now because it was linked to the one you referred to. – FxMySz Feb 22 '24 at 05:18

0 Answers0