Path: utzoo!attcan!uunet!lll-winken!ncis.tis.llnl.gov!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!terra.oscs.montana.edu!iphwk From: iphwk@terra.oscs.montana.edu (Bill Kinnersley) Newsgroups: comp.arch Subject: Re: Divide by three? Message-ID: <8906020201.AA10938@terra.oscs.montana.edu> Date: 2 Jun 89 02:01:39 GMT Organization: Digital Equipment Corporation Lines: 26 [In "Divide by three?" shs@uts.amdahl.com (Steve Schoettler) said:] : : Here's a puzzle: : What's the fastest way to divide an 11 bit number by three, : on a processor that doesn't have any multiply or divide instructions? : How about using the identity 1/3 = 1/4 + (1/4)^2 + (1/4)^3 + ... In other words, term = number ans = 0 for i=1 to 6 term = term/4 ans = ans + term -- --Bill Kinnersley Physics Department Montana State University Bozeman, MT 59717 INTERNET: iphwk@terra.oscs.montana.edu BITNET: IPHWK@MTSUNIX1 226 Transfer complete.