X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/blobdiff_plain/a305e8a577403b7c952e3900f64bbacf464edd98..HEAD:/BigUnsigned.hh diff --git a/BigUnsigned.hh b/BigUnsigned.hh index 683ac8b..adf1c00 100644 --- a/BigUnsigned.hh +++ b/BigUnsigned.hh @@ -103,7 +103,7 @@ public: /* Get the state of bit bi, which has value 2^bi. Bits beyond the * number's length are considered to be 0. */ bool getBit(Index bi) const { - return (getBlock(bi / N) & (1 << (bi % N))) != 0; + return (getBlock(bi / N) & (Blk(1) << (bi % N))) != 0; } /* Sets the state of bit bi to newBit. The number grows or shrinks as * necessary. */