Skip to content

Commit

Permalink
Use constant unsigned type for denominator
Browse files Browse the repository at this point in the history
  • Loading branch information
filterpaper committed Jun 19, 2023
1 parent 2a81d5d commit dc347f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quantum/mousekey.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
static inline int8_t times_inv_sqrt2(int8_t x) {
// 181/256 (0.70703125) is used as an approximation for 1/sqrt(2)
// because it is close to the exact value which is 0.707106781
int16_t n = x * 181, d = 256;
const int16_t n = x * 181;
const uint16_t d = 256;

// To ensure that the integer result is rounded accurately after
// division, check the sign of the numerator:
Expand Down

0 comments on commit dc347f8

Please sign in to comment.