Re: [IDEA+RFC] Possible solution for min()/max() war

From: Kai Henningsen (kaih@khms.westfalen.de)
Date: Fri Aug 31 2001 - 03:04:00 EST


phillips@bonn-fries.net (Daniel Phillips) wrote on 30.08.01 in <20010830171934Z16012-32384+1116@humbolt.nl.linux.org>:

> On August 30, 2001 07:03 pm, Peter T. Breuer wrote:
> > "Daniel Phillips wrote:"
> > > More than anything, it shows that education is needed, not macro
> patch-ups.
> > > We have exactly the same issues with < and >, should we introduce
> > > three-argument macros to replace them?
> >
> > # define le(t,a,b) ({ t _a = a; t _b = b; min(t,_a,_b) == _a ; })
> > # define ge(t,a,b) ({ t _a = a; t _b = b; min(t,_a,_b) == _b ; })
>
> Oh, you are one sick puppy.
>
> For completeness:
>
> # define lt(t,a,b) ({ t _a = a; t _b = b; min(t,_a,_b) != _b ; })
> # define gt(t,a,b) ({ t _a = a; t _b = b; min(t,_a,_b) != _a ; })

Does it give the right answers for floating point?

MfG Kai
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Aug 31 2001 - 21:00:34 EST