Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Oliver Sedlacek
07/16/12 22:25
Read: 514 times

#187955 - Guard digits?
Responding to: ???'s previous message
It sounds to me like you are lacking guard digits. These are the extra digits (or bits when thinking in binary) that preserve the accuracy of your intermediate variables. If you are using all 16 bits then you don't have any guard bits available, and whether you use a divide instruction or a shift instruction doesn't affect the result.

Adding 0.5 lsbs before rounding changes your code from biased rounding to unbiased rounding, but you need somewher to store that 0.5 lsb.

List of 9 messages in thread
Right Shift Rounding Recommendations      Jeremy Brookley      07/16/12 10:30      
   add before shift      Per Westermark      07/16/12 11:12      
   Guard digits?      Oliver Sedlacek      07/16/12 22:25      
      How does this look?      Jeremy Brookley      07/17/12 05:21      
         Nice but..      Oliver Sedlacek      07/18/12 09:55      
   Please elaborate further.      Christoph Franck      07/19/12 04:33      
             Jeremy Brookley      07/19/12 10:02      
      I do not know how you managed, but      Erik Malund      07/19/12 12:48      
         breaking the rules, one forum at a time . . .      Jeremy Brookley      07/19/12 13:59      

Back to Subject List