The tester still sometimes picks up a fith Rational<Arbint> /= operation though.
+ result.m_sign = !(m_sign == div.m_sign);
}
Arbint & Arbint::operator+=(const Arbint & add)
}
Arbint & Arbint::operator+=(const Arbint & add)
m_digits[0] = 0L;
return *this;
}
m_digits[0] = 0L;
return *this;
}
Rational(double d=0) : P(d*1e6), Q(1e6) // Possibly the worst thing ever...
{
Simplify();
Rational(double d=0) : P(d*1e6), Q(1e6) // Possibly the worst thing ever...
{
Simplify();
- //if (!CheckAccuracy(d, "Construct from double"))
- {
- //Fatal("Bwah bwah :(");
- }
}
Rational(const T & _P, const T & _Q) : P(_P), Q(_Q)
}
Rational(const T & _P, const T & _Q) : P(_P), Q(_Q)
-bool NotEqual(double a, double b, double threshold=1e-2)
+static double g_totalerror = 0;
+
+bool NotEqual(double a, double b, double threshold=1e-1)
- return (fabs(a-b) > threshold);
+ double error = (fabs(a-b) > threshold);
+ g_totalerror += error;
+ return (error > threshold);
}
int main(int argc, char ** argv)
}
int main(int argc, char ** argv)
}
}
Debug("Completed %u test cases with total of %u operations, %u failures", TEST_CASES, 12*TEST_CASES, failures);
}
}
Debug("Completed %u test cases with total of %u operations, %u failures", TEST_CASES, 12*TEST_CASES, failures);
+ Debug("Total accumulated difference between Real and Double operations was %f", g_totalerror);