am 5b3eb07e
: Merge "Prevent bit shifting if num bits is negative"
* commit '5b3eb07ed730f9765c93afcb7f49559c212fe533': Prevent bit shifting if num bits is negative
This commit is contained in:
commit
9c1c205931
1 changed files with 2 additions and 1 deletions
|
@ -62,7 +62,8 @@ int32_t gglRecipQ(GGLfixed x, int q)
|
|||
int shift;
|
||||
x = gglRecipQNormalized(x, &shift);
|
||||
shift += 16-q;
|
||||
x += 1L << (shift-1); // rounding
|
||||
if (shift > 0)
|
||||
x += 1L << (shift-1); // rounding
|
||||
x >>= shift;
|
||||
return x;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue