Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


Returns the larger of two values.

type __max(
   type a,
   type b 


Any numeric data type.
a, b
Values of any numeric type to be compared.

Return Value

__max returns the larger of its arguments.


The __max macro compares two values and returns the value of the larger one. The arguments can be of any numeric data type, signed or unsigned. Both arguments and the return value must be of the same data type.


Routine Required header Compatibility
__max <stdlib.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.


All versions of the C run-time libraries.


See the example for __min.

See Also

Floating-Point Support Routines | __min | Run-Time Routines and .NET Framework Equivalents

© 2015 Microsoft