Question about int result of relational operator

Randy D. Miller randy at gtx.com
Wed Nov 2 02:33:45 AEST 1988


I've seen conflicting information about the int result of a relational
operator in which the condition is satisfied.  Does it evaluate to
exactly one, or just "non-zero" ?  E.g., can we test whether two
comparisons have the same relational result with the following ?
(Obviously there are other ways of doing this, but that is not the 
question here.)

   int a,b,c,d;
   if ((a > b) == (c > d)) { 
      /* both tests have the same relational result */
   }

-- 
Randy D. Miller             (602) 870-1696
GTX Corp., 8836 N. 23rd Ave., Phoenix, AZ 85021
{cbosgd,decvax,hplabs,amdahl,nsc}!sun!sunburn!gtx!randy



More information about the Comp.lang.c mailing list