rcmp.cpp 467 B

12345678910111213141516171819
  1. #include "testlib.h"
  2. #include <stdio.h>
  3. #include <math.h>
  4. const double EPS = 1.5E-6;
  5. int main(int argc, char * argv[])
  6. {
  7. setName("compare two doubles, maximal absolute error = %.10f", EPS);
  8. registerTestlibCmd(argc, argv);
  9. double ja = ans.readDouble();
  10. double pa = ouf.readDouble();
  11. if (fabs(ja - pa) > EPS + 1E-15)
  12. quitf(_wa, "expected %.10f, found %.10f", ja, pa);
  13. quitf(_ok, "answer is %.10f", ja);
  14. }