• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [SOLVED] Clamp in/exclusivity

A

a52

Guest
Is the clamp function in GML inclusive or exclusive? (ie, can the value clamped equal the bounds, or must it stay just below or just above?)

In the documentation, it says that it clamps the input between the two bounds, which suggests it is exclusive in both bounds. However, later in the same page, it says that clamp prevents the value from falling below or going above the bounds, which suggest that it is inclusive in both bounds.

Furthermore, in most other programming languages I've used, these types of functions are usually lower-bound inclusive and higher-bound exclusive.

Which is it?
 

Tthecreator

Your Creator!
It can be can between and equal to the values, meaning it's inclusive.
It's lower bound and hight bound inclusive.
 
Top