Last active
August 29, 2015 14:23
-
-
Save rasgo-cc/1cbf9cc771d5fc54b155 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
op1 = (int32_t)(f_op1*(double)scaler); // op1 in Qn format | |
op2 = (int32_t)(f_op2*(double)scaler); // op2 in Qn format | |
// Convert the dividend to Q(2*n) format | |
tmp = ((uint64_t)op1 << Qn); | |
// Round by summing half the divisor | |
tmp += op2 >> 1; | |
// Division | |
tmp /= (uint64_t)(op2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment