#if wxUSE_STD_IOSTREAM
// input/output
-ostream& operator<< (ostream& o, const wxLongLongNative& ll)
+wxSTD ostream& operator<< (wxSTD ostream& o, const wxLongLongNative& ll)
{
char result[65];
- memset(result, 'A', 64);
+ wxSTD memset(result, 'A', 64);
result[64] = '\0';
for (int i = 0; i < 64; i++)
{
- result[63 - i] = '0' + (char) ((ll.m_ll >> i) & 1);
+ result[63 - i] = '0' + (char) ((ll.GetValue() >> i) & 1);
}
return o << result;
{
bool positive = d >= 0;
d = fabs(d);
- if ( d <= LONG_MAX )
+ if ( d <= ULONG_MAX )
{
m_hi = 0;
m_lo = (long)d;
}
else
{
-#if 0
- m_lo = (long)d;
- d -= m_lo;
- d /= 0x1000;
- d /= 0x1000;
- d /= 0x100;
- m_hi = (long)d;
-#else
- wxFAIL_MSG(_T("TODO"));
-#endif
+ m_hi = (unsigned long)(d / (1.0 + (double)ULONG_MAX));
+ m_lo = (unsigned long)(d - ((double)m_hi * (1.0 + (double)ULONG_MAX)));
}
- if ( !positive )
- m_hi = -m_hi;
-
#ifdef wxLONGLONG_TEST_MODE
m_ll = (wxLongLong_t)d;
Check();
#endif // wxLONGLONG_TEST_MODE
+ if ( !positive )
+ Negate();
+
return *this;
}
Divide(ll, quotient, remainder);
- return *this = quotient;
+ *this = quotient;
+
+ return *this;
}
wxLongLongWx wxLongLongWx::operator%(const wxLongLongWx& ll) const
#if wxUSE_STD_IOSTREAM
// input/output
-ostream& operator<< (ostream& o, const wxLongLongWx& ll)
+wxSTD ostream& operator<< (wxSTD ostream& o, const wxLongLongWx& ll)
{
char result[65];