diff --git a/ttmath/ttmathtypes.h b/ttmath/ttmathtypes.h index 414170b..1fab61a 100644 --- a/ttmath/ttmathtypes.h +++ b/ttmath/ttmathtypes.h @@ -64,8 +64,8 @@ */ #define TTMATH_MAJOR_VER 0 #define TTMATH_MINOR_VER 8 -#define TTMATH_REVISION_VER 1 -#define TTMATH_PRERELEASE_VER 0 +#define TTMATH_REVISION_VER 2 +#define TTMATH_PRERELEASE_VER 1 /*! diff --git a/ttmath/ttmathuint.h b/ttmath/ttmathuint.h index 8e0cefb..60de59d 100644 --- a/ttmath/ttmathuint.h +++ b/ttmath/ttmathuint.h @@ -1529,6 +1529,34 @@ public: } + /*! + this method performs a bitwise operation NOT but only + on the range of <0, leading_bit> + + for example: + BitNot2(8) = BitNot2( 1000(bin) ) = 111(bin) = 7 + */ + void BitNot2() + { + uint table_id, index; + + if( FindLeadingBit(table_id, index) ) + { + for(uint x=0 ; x>= shift; + + table[table_id] ^= mask; + } + else + table[0] = 1; + } + /*!