Skip to content

Instantly share code, notes, and snippets.

@yannxou
Created May 3, 2015 22:05
Show Gist options
  • Save yannxou/2e93dceff309c9153f19 to your computer and use it in GitHub Desktop.
Save yannxou/2e93dceff309c9153f19 to your computer and use it in GitHub Desktop.
Macro to easily bound a number within an upper/lower range
#define BOUND(VALUE, UPPER, LOWER) MIN(MAX(VALUE, LOWER), UPPER)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment