Path: utzoo!utgpu!watmath!att!bellcore!rutgers!iuvax!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald
From: mcdonald@uxe.cso.uiuc.edu
Newsgroups: comp.lang.c
Subject: Re: What I'd really like to see in an i
Message-ID: <225800205@uxe.cso.uiuc.edu>
Date: 7 Aug 89 13:25:00 GMT
References: <5024@alvin.mcnc.org>
Lines: 14
Nf-ID: #R:alvin.mcnc.org:5024:uxe.cso.uiuc.edu:225800205:000:426
Nf-From: uxe.cso.uiuc.edu!mcdonald    Aug  7 08:25:00 1989



It would seem that the expression a < b < c is legal C, and might
be a useful construct (especially in the Obfuscated C Contest...).
In fact, it is actually mentioned as legal in K&R I, on page 189.
Of course, they say it "does not mean what it seems to". It also
says relational operators group left-to-right, so it is

(a < b ) < c  .

This tests for c less than 1 or 0 depending on whether  a < b or not.


Doug McDonald