Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: % operator with negatives
Message-ID: <1990Dec12.205416.26622@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <1990Dec12.185714.7169@mp.cs.niu.edu>
Date: Wed, 12 Dec 90 20:54:16 GMT

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.

If you're asking the obvious question -- "what's the sign of the remainder?",
i.e. "which way does the rounding of the quotient go?" -- there is no
portable answer.  It's implementation-specific.
-- 
"The average pointer, statistically,    |Henry Spencer at U of Toronto Zoology
points somewhere in X." -Hugh Redelmeier| henry@zoo.toronto.edu   utzoo!henry
