Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!sarah!bingnews!kym From: kym@bingvaxu.cc.binghamton.edu (R. Kym Horsell) Newsgroups: comp.arch Subject: Re: RISC integer multiply/divide (was Re: Snake) Message-ID: <1991Apr7.184545.15636@bingvaxu.cc.binghamton.edu> Date: 7 Apr 91 18:45:45 GMT References: <1991Apr4.213550.8106@bingvaxu.cc.binghamton.edu> <1991Apr5.191136.21806@bingvaxu.cc.binghamton.edu> <3276@charon.cwi.nl> Organization: State University of New York at Binghamton Lines: 12 In article <3276@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes: > > mid=bd+ac+(bd>>SHORTBITS); >This can fail. 0 <= a,b,c,d < 2^16, so >0 <= mid < 2^33+2^16. You do not handle the overflow. Hmmm. While we're talking about accuracy -- I get 0 <= mid <= 2^33 - 3*2^16 + 1. You seem to indicate >1 bits of overflow may be required. -kym -- main(){int i=0,b=0,c=0,n=0;while(i<1920){if((b>>=1)<2) b=n*n++;printf("\n%c"+!!(++i%80)," #"[(c^=1)^(b&1)]);}}