Right shift vs. divide

johnl at ima.UUCP johnl at ima.UUCP
Thu Jan 2 14:01:00 AEST 1986

Now that we know that right shifting is not the same as division, has 
anybody ever come up with a plausible reason for computers to have 
arithmetic shift instructions on twos complement machines (other than that 
they're easy to implement and poorly educated engineers might have thought 
they were the same as division)?  For positive numbers, they give the same 
result as unsigned shifts, and for negative numbers they give the wrong 
answer.  Followups to net.arch, please.  

John Levine, ima!johnl

More information about the Comp.lang.c mailing list