% operator with negatives

Jim Chargin jimc at gold.gvg.tek.com
Tue Dec 18 05:49:23 AEST 1990


In article <1990Dec17.175010.12654 at agate.berkeley.edu>, bks at alfa.berkeley.edu (Brad Sherman) writes:

> For those wishing to implement a modulous function that behaves in 
> a reasonable manner for all integers I offer the following notes
> taken from a book by Knuth and others (title forgotten).
> 
> 	To make "m mod n" well defined for any integer value, positive
> 	or negative start from the relation:
>	. . .

I believe the book referred to is:

    Concrete Mathematics: a foundation for computer science
    Ronald L. Graham, Donald E. Knuth, Gren Patashnik
    Addison Wesley, 1989
    ISBN 0-201-14236-8


Jim



More information about the Comp.lang.c mailing list