N
Noob
Hello,
I'm sure this topic has been beaten to death, but my google-fu
has apparently failed me this time.
As far as I can tell, the standard library does not provide
functions (or macros) to compute the minimum and maximum of
two values, be they integral values, or floating point values;
leaving it up to each programmer in the world to roll their own.
Is this correct?
What is the rationale for this omission in C89? in C99?
Is it because it is "simple" to implement as a macro?
Something along the lines of #define MIN(a,b) (((a)<(b))?(a)
b))
Regards.
I'm sure this topic has been beaten to death, but my google-fu
has apparently failed me this time.
As far as I can tell, the standard library does not provide
functions (or macros) to compute the minimum and maximum of
two values, be they integral values, or floating point values;
leaving it up to each programmer in the world to roll their own.
Is this correct?
What is the rationale for this omission in C89? in C99?
Is it because it is "simple" to implement as a macro?
Something along the lines of #define MIN(a,b) (((a)<(b))?(a)
Regards.