deepstone
diff src/fixedp.h @ 27:dcfe615c4c5f
moved firstp.c to main.c
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 22 Sep 2013 02:47:46 +0300 |
parents | 61d97b17cd2b |
children | 1fa939507d8b |
line diff
1.1 --- a/src/fixedp.h Sun Sep 22 02:25:41 2013 +0300 1.2 +++ b/src/fixedp.h Sun Sep 22 02:47:46 2013 +0300 1.3 @@ -86,7 +86,7 @@ 1.4 #define fixed_mul(n1, n2) (fixed)((n1) * (n2) >> FIXED_SHIFT) 1.5 #define fixed_div(n1, n2) (((n1) << FIXED_SHIFT) / (n2)) 1.6 #else 1.7 -#define fixed_div(n1, n2) (((int64_t)(n1) << FIXED_SHIFT) / (int64_t)(n2)) 1.8 +#define fixed_div(n1, n2) (((n2) >> 8) ? (((n1) << 8) / ((n2) >> 8)) : (n1)) 1.9 #define fixed_mul(n1, n2) (((n1) >> 8) * ((n2) >> 8)) 1.10 #endif /* DECIMAL_BITS */ 1.11