Skip to content

Macro to clamp a value between two other values

License

Notifications You must be signed in to change notification settings

littlstar/clamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clamp

Macro to clamp a value between two other values

Installation

$ clib install littlstar/clamp --save

Usage

int value = 5;
value = clamp(value 0, 4);
assert(4 == value);

License

MIT