Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!gvgpsa!gold.gvg.tek.com!jimc From: jimc@gold.gvg.tek.com (Jim Chargin) Newsgroups: comp.lang.c Subject: Re: % operator with negatives Summary: Info on book cited Message-ID: <1810@gold.gvg.tek.com> Date: 17 Dec 90 18:49:23 GMT References: <7461:Dec1310:04:0990@kramden.acf.nyu.edu> <1529@bbxsda.UUCP> <1990Dec17.175010.12654@agate.berkeley.edu> Organization: Grass Valley Group, Grass Valley, CA Lines: 19 In article <1990Dec17.175010.12654@agate.berkeley.edu>, bks@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