??? 07/16/12 16:30 Read: times |
#187952 - Right Shift Rounding Recommendations |
Hello everyone!
So, I am trying to right shift a signed short, which is causing me the number to always round down (which makes sense). I am trying to decide the best way to deal with the issue as it is creating cascading problems for my program. I'd rather not divide as it takes many more calculations (16, if I remember correctly) to do a division calculation but only a single cycle to do a right shift. Since I right shift in a number of places (and I'd like the function to take as little time as possible), the time it takes to complete the division cycles adds up quick. My question is is there another way or a workaround for this problem or am I stuck using using division for this? Any help you can give me would be GREATLY appreciated. Thanks! -Jeremy |
Topic | Author | Date |
Right Shift Rounding Recommendations | 01/01/70 00:00 | |
add before shift | 01/01/70 00:00 | |
Guard digits? | 01/01/70 00:00 | |
How does this look? | 01/01/70 00:00 | |
Nice but.. | 01/01/70 00:00 | |
Please elaborate further. | 01/01/70 00:00 | |
01/01/70 00:00 | ||
I do not know how you managed, but | 01/01/70 00:00 | |
breaking the rules, one forum at a time . . . | 01/01/70 00:00 |