X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fparanoidnumber.h;h=041e445cde382ee2adf676fbf9ab39f0353f0c35;hp=e57d00c64ff0b6f2e2a5459732f522722b243fae;hb=3917214a11bf76381ddc528e3fe51de9ec038d42;hpb=71df61ab8ea302247ad35ccdc973bc8e0cafd5b1 diff --git a/src/paranoidnumber.h b/src/paranoidnumber.h index e57d00c..041e445 100644 --- a/src/paranoidnumber.h +++ b/src/paranoidnumber.h @@ -19,7 +19,7 @@ //#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 @@ -87,7 +87,7 @@ namespace IPDF ParanoidNumber(PARANOID_DIGIT_T value=0) : m_value(value), m_next() { #ifdef PARANOID_SIZE_LIMIT - m_size = 0; + m_size = 1; #endif #ifdef PARANOID_CACHE_RESULTS m_cached_result = value; @@ -235,6 +235,8 @@ namespace IPDF 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);