Why were IntConstrainedValue and DoubleConstrainedValue Deprecated?

So I have a Small Question about these two Deprecated Instances, which can probably be answered very quickly.

So a while ago I was looking into these Instances as I had recently found them, and they were appearently Deprecated because of math.clamp(), but why for that reason? They seemed like useful ValueBase Objects?

1 Like

Reading is useful :slight_smile:

They know :slight_smile:, they’re asking why for that particular reason.

I guess it was a design decision. Int and double constrained values were deprecated about a week after math.clamp (luau specific) was introduced in 2017.

I’d say those values generally became more or less obsolete at that point. math.clamp also promotes higher awareness of which scripts modify the value. The actual practical usefulness? They contain max and min properties, which comes handy when reading the values, for example calculating percentage.

local percentage = (constrInt.Value - constrInt.MinValue) / (constrInt.MaxValue - constrInt.MinValue)

Thanks, but for the other person, Irony


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.