X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/ce541a0ec0b78847792b0a81b829bc76f9c5efcb..c29970a7717261e63ffaabb3c67381f13c5dbca5:/mp-arith.c diff --git a/mp-arith.c b/mp-arith.c index 3af1447..9cb5178 100644 --- a/mp-arith.c +++ b/mp-arith.c @@ -652,16 +652,16 @@ mp *mp_odd(mp *d, mp *m, size_t *s) ss = 0; else { mpw x = *v; - mpw mask = MPW_MAX; - unsigned z = MPW_BITS / 2; + unsigned z = MPW_P2; + mpw mask = ((mpw)1 << z) - 1; while (z) { - mask >>= z; if (!(x & mask)) { x >>= z; ss += z; } z >>= 1; + mask >>= z; } }