You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
452 B

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