Xref: utzoo comp.misc:8387 comp.lang.misc:4325 comp.arch:14377 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!cam-cl!cet1 From: cet1@cl.cam.ac.uk (C.E. Thompson) Newsgroups: comp.misc,comp.lang.misc,comp.arch Subject: Re: Modulus Message-ID: <1791@gannet.cl.cam.ac.uk> Date: 2 Mar 90 22:15:42 GMT References: <981@m1.cs.man.ac.uk> <12115@goofy.megatest.UUCP> <2573@castle.ed.ac.uk> Sender: news@cl.cam.ac.uk Reply-To: cet1@cl.cam.ac.uk (C.E. Thompson) Organization: U of Cambridge Comp Lab, UK Lines: 12 In article <2573@castle.ed.ac.uk> db@lfcs.ed.ac.uk (Dave Berry) writes: > >Almost certainly becasue that's how the hardware does it. Almost all >processors implements integer division and modulus that way.o *Very* few processors produce a "natural" div and rem/mod which are not related by (i div j)*j + (i rem j) = i. Therefore no Pascal implementation that passes the validation tests can be as naive as you suggest. Chris Thompson JANET: cet1@uk.ac.cam.phx Internet: cet1%phx.cam.ac.uk@nsfnet-relay.ac.uk