% operator with negatives
Dan Bernstein
brnstnd at kramden.acf.nyu.edu
Mon Dec 17 05:38:44 AEST 1990
In article <1990Dec14.153706.14688 at math.lsa.umich.edu> kevin at 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
More information about the Comp.lang.c
mailing list