diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-05 00:44:55 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-05 01:40:40 +0200 |
commit | 6e6b888e31f9a4c245f621ccd91d3fce5ac88463 (patch) | |
tree | c094e79aded8db5308c45c3d385402f6b45c7d87 /py | |
parent | e0723497b3dbce94e6ce2a2dcd59af510f094fa4 (diff) | |
download | micropython-6e6b888e31f9a4c245f621ccd91d3fce5ac88463.tar.gz micropython-6e6b888e31f9a4c245f621ccd91d3fce5ac88463.zip |
Add generic MIN()/MAX() functions.
Diffstat (limited to 'py')
-rw-r--r-- | py/misc.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -10,6 +10,11 @@ typedef unsigned char byte; typedef unsigned int uint; +/** generic ops *************************************************/ + +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#define MAX(x, y) ((x) > (y) ? (x) : (y)) + /** memomry allocation ******************************************/ // TODO make a lazy m_renew that can increase by a smaller amount than requested (but by at least 1 more element) |