35 static const unsigned k_UNIT_BITS = 64;
38 static const unsigned k_UNIT_BITS = 32;
45 #elif defined(USE_LITTLE_ENDIAN)
83 return m_uLo == 0 && m_uHi == 0;
102 if (nBit < k_UNIT_BITS)
113 return m_uLo == n.m_uLo && m_uHi == n.m_uHi;
118 return !(*
this == n);
133 if (m_uHi == n.m_uHi)
134 return m_uLo > n.m_uLo;
136 return m_uHi > n.m_uHi;
145 if (m_uHi == n.m_uHi)
146 return m_uLo < n.m_uLo;
148 return m_uHi < n.m_uHi;
157 if (m_uHi == n.m_uHi)
158 return m_uLo <= n.m_uLo;
160 return m_uHi < n.m_uHi;
164 template <
typename TYPE>
188 void operator ++(
int)
205 void operator --(
int)
246 ans.m_u = m_u * x.m_u;
266 m_u |= ((
UNIT_t)1) << uiBit;
268 if (uiBit < k_UNIT_BITS)
270 m_uLo |= ((
UNIT_t)1) << uiBit;
274 m_uHi |= ((
UNIT_t)1) << (uiBit - k_UNIT_BITS);
317 if (uiBits < k_UNIT_BITS)
319 (m_uHi <<= uiBits) |= (m_uLo >> (k_UNIT_BITS - uiBits));
324 m_uHi = m_uLo << (uiBits - k_UNIT_BITS);
336 if (uiBits < k_UNIT_BITS)
338 (m_uLo >>= uiBits) |= (m_uHi << (k_UNIT_BITS - uiBits));
343 m_uLo = m_uHi >> (uiBits - k_UNIT_BITS);
352 bool SetStr(
const char* pszVal,
RADIX_t nBaseRadix = 10,
const char** ppszEnd = (
const char**)
nullptr);
358 bool isPrime()
const;
360 void OpBitShiftLeft1(UNIT_t nBitMask);
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define CATTR_PACKED
Definition: GrayCore.h:87
Using X files without the sources and the makefile How to use you just create a debug directory e g
Definition: Readme.txt:21
#define TYPE
Definition: StrT.cpp:38
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define ASSERT(exp)
Definition: cDebugAssert.h:87
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
Definition: cThreadLock.h:137
bool isOdd() const
Definition: cUInt64.h:86
void operator--()
Definition: cUInt64.h:194
bool operator<(const cUInt64 &n) const
Definition: cUInt64.h:140
bool operator>(const cUInt64 &n) const
Definition: cUInt64.h:128
cUInt64(UNIT_t n)
Definition: cUInt64.h:63
bool IsSet(BIT_ENUM_t nBit) const
Definition: cUInt64.h:94
cUInt64 & operator>>=(BIT_ENUM_t uiBits)
Definition: cUInt64.h:331
cUInt64 & operator<<=(BIT_ENUM_t uiBits)
Definition: cUInt64.h:312
cUInt64()
Definition: cUInt64.h:54
void operator++()
Definition: cUInt64.h:177
cUInt64 & operator&=(const cUInt64 &n)
Definition: cUInt64.h:290
cUInt64 & operator+=(const cUInt64 &n)
Definition: cUInt64.h:211
cUInt64(const char *pszVal, RADIX_t n=10)
Definition: cUInt64.h:72
cUInt64 & operator^=(const cUInt64 &n)
Definition: cUInt64.h:301
TYPE get_Val() const
Definition: cUInt64.h:165
cUInt64 & operator-=(const cUInt64 &n)
Definition: cUInt64.h:223
cUInt64 & operator|=(const cUInt64 &n)
Definition: cUInt64.h:279
bool isZero() const
Definition: cUInt64.h:78
void SetBit(BIT_ENUM_t uiBit)
Definition: cUInt64.h:263
UINT64 UNIT_t
Definition: cUInt64.h:34
cVecT2< TYPE > operator*(const TYPE nVal, const cVecT2< TYPE > &v2)
Definition: cVecT.h:522
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
cUInt64 operator|(const cUInt64 &roUI64_1, const cUInt64 &roUI64_2)
Definition: cUInt64.h:377
int StrLen_t
the length of a string in chars (bytes for UTF8, wchar_t for UNICODE). or offset in characters....
Definition: StrConst.h:32
void operator>>(cArchive &ar, cStringT< _TYPE_CH > &pOb)
Definition: cString.h:678
cUInt64 operator^(const cUInt64 &roUI64_1, const cUInt64 &roUI64_2)
Definition: cUInt64.h:391
WORD RADIX_t
Base for convert of numbers to strings. e.g. 10 base vs 16 base hex numbers.
Definition: StrChar.h:27
unsigned int BIT_ENUM_t
Enumerate number of bits or address a single bit in some array of bits.
Definition: cBits.h:20
cStringA operator+(const char *pStr1, const cStringA &s2)
Definition: cString.h:642
void operator<<(cArchive &ar, const cStringT< _TYPE_CH > &pOb)
Definition: cString.h:680
bool operator!=(const cTimeDouble &dt1, const cTimeDouble &dt2)
Definition: cTimeDouble.h:254
bool operator==(const cTimeDouble &dt1, const cTimeDouble &dt2)
Definition: cTimeDouble.h:250
bool operator<=(const cTimeDouble &dt1, const cTimeDouble &dt2)
Definition: cTimeDouble.h:238
cUInt64 operator&(const cUInt64 &roUI64_1, const cUInt64 &roUI64_2)
Definition: cUInt64.h:384
static constexpr bool IsSet(TYPE nVal, BIT_ENUM_t nBit) noexcept
Definition: cBits.h:77