X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/blobdiff_plain/4f4a02c2256d1e4a45eaa9b05bcb5f85e7652bc2..c17afa550d0a00498301454195699120e2bf58c5:/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. */