Truncated match.
PICList
Thread
'Divide by 10'
1996\05\29@140451
by
fastfwd

Dudes:
The following is from Pete Brink (spam_OUTpete.brinkTakeThisOuTmicrochip.com), who is
having trouble posting directly to the list:
 Forwarded Message Follows 
Here was my answer to the divide by 10 problem. It's kind of based
upon how floating point format works, successive divisions by
multiples of two to approximate a multiply.
One solution would be to perform a conversion to a multiple of 16.
That is, (1.6 * X) / 16. The operation can be done entirely with
shifts and adds. As a quick approximation I came up with:
(X + (X >> 1) + (X >> 4) + (X >> 5)) >> 4 = X / 10.
This calculation yields (1.59375 * X) / 16 (0.3% error). You can get
even closer with more shifting, but it rapidly becomes more costly
than a lookup table in runtime processing.
Pete
 End of Forwarded Message 
Andrew Warren  .....fastfwdKILLspam@spam@ix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499
More... (looser matching)
 Last day of these posts
 In 1996
, 1997 only
 Today
 New search...