Max()

From Microduino Wiki
Jump to: navigation, search
#define max(a, b) ((a)>(b)?(a):(b))

The maximum value

Take the maximum between two numbers, for example:

sensVal = max(senVal, 20); // assigns sensVal to the larger of sensVal or 20
                           // (effectively ensuring that it is at least 20)

[Return to Arduino Syntax Manual]