Calculate Node: clamp to one bound?

In the Calculate node, would it be possible to have a clamp to one bound only?

Let’s say I have data that is “naturally” bounded to 0 for the low limit, I don’t really need the formula to check if that data is going lower than 0. I only need the formula to check if the data is going over the high limit and clamp it to that high limit.

I’m asking this because I imagine that checking only one limit would save a few CPU cycles.

Instead of the two-sided limit with clamp, you could do a one-sided limit with min or max — for example min(value, highLimit).

1 Like

I looked for that, but it’s not explicitly there in the node’s description (or at least in a fashion I was able to understand…):

@Kewl, thanks for pointing that out. I’d like to clarify the documentation. It sounds like you understood that you could use clamp (whose documentation explains x, min, max) but not min and max?

Exactly. Since there’s clamp(x,min,max), I would have expected min(x,min) and max(x,max).

Thanks for the follow up.

We’ve clarified the node documentation in release 1.2.6.