Why no min / max
- From: Noob <root@xxxxxxxxx>
- Date: Fri, 26 Nov 2010 16:12:26 +0100
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))
- Prev by Date: latest Hollywood Movies
- Next by Date: Re: Why no min / max
- Previous by thread: latest Hollywood Movies
- Next by thread: Re: Why no min / max