#ifdef PARANOID_SIZE_LIMIT
if (m_size >= PARANOID_SIZE_LIMIT)
{
+ this->operator=(this->Digit());
if (op == ADD)
- {
- m_value += b->Digit() / GetFactors();
- }
+ m_value += b->Digit();
else
- {
- m_value -= b->Digit() / GetFactors();
- }
+ m_value -= b->Digit();
+ m_size = 0;
+ Debug("Cut off %p", this);
return b;
}
//Debug("At size limit %d", m_size);
#ifdef PARANOID_SIZE_LIMIT
if (m_size >= PARANOID_SIZE_LIMIT)
{
+ this->operator=(this->Digit());
if (op == MULTIPLY)
m_value *= b->Digit();
else
m_value /= b->Digit();
-
- for (auto n : m_next[ADD])
- delete n->OperationFactor(new ParanoidNumber(*b), op);
- for (auto n : m_next[SUBTRACT])
- delete n->OperationFactor(new ParanoidNumber(*b), op);
+ m_size = 0;
+
+ Debug("Cut off %p", this);
return b;
}
//#define PARANOID_CACHE_RESULTS
//#define PARANOID_USE_ARENA
-#define PARANOID_SIZE_LIMIT 0
+#define PARANOID_SIZE_LIMIT 1
// Define to compare all ops against double ops and check within epsilon
inline void CompareForSanityEx(const char * func, const char * file, int line, const digit_t & compare, const digit_t & arg, const digit_t & eps = PARANOID_COMPARE_EPSILON)
{
+ if (!SanityCheck())
+ Fatal("This is insane!");
if (fabs(Digit() - compare) > eps)
{
Error("Called via %s(%lf) (%s:%d)", func, arg, file, line);