Min(), Max()

Min() returns the smallest value from a list of values. Max() returns the largest value. The Function accepts a variable number of parameters (2 to 255). The first value's data type defines the function type. All other parameters are assumed to be of this type and converted to that type if required.

PreprocessorThe function is available in the Preprocessor, and does not create machine code because only constants are used.

Syntax:

Example:

const F_CPU = 8000000
avr.device = attiny2313
avr.clock  = F_CPU
avr.stack = 8
uart.baud = 19200
uart.recv.enable
uart.send.enable
dim i as byte
dim a,b,c as integer
print 12;"min()/max() example"
print
a = -170
b = 8011
c = 230
print str(min(a,b,c))
print str(max(a,b,c))
print "ready"
do
loop