Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!haven!ncifcrf!lhc!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: % operator with negatives Message-ID: <14722@smoke.brl.mil> Date: 12 Dec 90 20:40:18 GMT References: <1990Dec12.185714.7169@mp.cs.niu.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 8 In article <1990Dec12.185714.7169@mp.cs.niu.edu> t901908@mp.cs.niu.edu (Joe Adamo) writes: >I know this may sound silly, but what is the effect of using the >% (mod) operator with negatives? I can't seem to find any info on it. Two things: % is NOT a modulo operator; it's a remainder operator, which is not the same thing. Also, for negative operands there are implementation- dependent aspects to the result obtained; in most applications you should avoid using negative operands.