Type-independent absolute value

Maarten Litmaath maart at cs.vu.nl
Thu Oct 5 09:52:42 AEST 1989


davidsen at crdos1.crd.ge.COM (Wm E Davidsen Jr) writes:
\In article <1389 at cipc1.Dayton.NCR.COM>,
\	gmaranca at cipc1.Dayton.NCR.COM (Gabriel Maranca) writes:
\...
\|  #define ABS(x) (((long)(x) < 0L)? -(x) : (x))
\...
\	1. instead of -(x) use (-(x)). [...]

Why?  I can understand `-x' isn't a good idea, but `-(x)' seems OK to me.
-- 
   Did Andy Tanenbaum get his programming   |Maarten Litmaath @ VU Amsterdam: 
instruction from a Cereal box?  (Sam McCrea)|maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.lang.c mailing list