Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.UUCP Newsgroups: net.math Subject: Re: Ok, I give up! Message-ID: <2112@brl-tgr.ARPA> Date: Fri, 31-Jan-86 17:05:10 EST Article-I.D.: brl-tgr.2112 Posted: Fri Jan 31 17:05:10 1986 Date-Received: Mon, 3-Feb-86 05:47:07 EST References: <11594@ucbvax.BERKELEY.EDU> Organization: Ballistic Research Lab Lines: 14 > "%" is supposed to be a mod function ... No, in C the % operator is a remainder operator. Remember that C is intentionally vague on semantics in cases where precise specification might have forced additional run-time overhead in generated code. Another example is sign propagation on right-shifts. Yes, to get precise semantics you have to provide your own function (although this one really should be provided in the standard C library). Knuth Vol. 1 (2nd Ed.), p. 38 discusses the reasonable mathematical definition of the mod function.