Min/max macros including type checking.