Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!ncar!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: % operator with negatives Message-ID: <2620:Dec1618:38:4490@kramden.acf.nyu.edu> Date: 16 Dec 90 18:38:44 GMT References: <18140@neptune.inf.ethz.ch> <1990Dec14.064305.4491@dirtydog.ima.isc.com> <1990Dec14.153706.14688@math.lsa.umich.edu> Organization: IR Lines: 9 In article <1990Dec14.153706.14688@math.lsa.umich.edu> kevin@math.lsa.umich.edu (Kevin Coombes) writes: > f you know what types you're working with and you're worried about what > happens with negatives, you can always use the following function, which > is guaranteed to return an answer between 0 and p-1. No, it is not. If, for instance, a is -p and p is positive, your function will return p. ---Dan