Boolean Operators Slighted in C

Root Boy Jim rbj at icst-cmr
Fri May 16 03:27:45 AEST 1986


	XOR can be defined as an (ugly) macro, I believe.
	
	#define XOR(a,b) (((a) != 0) != ((b) != 0)
	/* or if you like small better than readable */
	#define XOR(a,b) (!!(a) != !!(b))
	-- 
		-bill davidsen
	
/* smaller still */
#define XOR(a,b) (!!(a) == !(b))

	(Root Boy) Jim Cottrell		<rbj at cmr>
	"One man gathers what another man spills"



More information about the Comp.lang.c mailing list