home *** CD-ROM | disk | FTP | other *** search
- From: dhandly@hpcuhe.cup.hp.com (Dennis Handly)
- Date: Fri, 21 Aug 1992 06:48:25 GMT
- Subject: Re: ksh bk-gnd behaviour
- Message-ID: <31480227@hpcuhe.cup.hp.com>
- Organization: Hewlett-Packard Cal Language Lab
- Path: sparky!uunet!usc!sdd.hp.com!hpscdc!cupnews0.cup.hp.com!hppad.waterloo.hp.com!hppad!hpfcso!hpcuhb!hpcuhe!dhandly
- Newsgroups: comp.sys.hp
- References: <891@marvin.jpl.oz>
- Lines: 14
-
- / tony@marvin.jpl.oz (Tony Sanderson) / 12:21 am Aug 19, 1992 /
- >PS 2: Just in case anyone reading this did answer another recent post re
- >methods for an efficient 16 bit integer divide-by-5 method (which I'm
- >looking for),
-
- Dividing by 5 is the same as multiplying by 3 and dividing by 15.
-
- Dividing by 15 is the same as sum(x/(16**n)) where n is 1..4 (or so for
- 16 bit integers).
-
- Check this out by dividing by 15 in base 16. (Or base 2)
-
- This can be done with shifts and adds. It might also need some carry/
- overflow checks.
-