Tag: Tricks

  • Python – Clamp

    Python – Clamp

    Here is a quick little trick – How to be sure that a value is between a minimum and a maximum? Say you have an algorithm that requires values between some arbitrary set of numbers, like -10.5 and 15.99. This function will clamp a number between your given boundaries, or clip it at those markers.…