mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-30 01:06:19 +00:00
96d4a3ecf7
Due to historical reasons, the code is in subfolder "1". With SVN removal, we place the code back and remove the annoying "1" folder.
20 lines
466 B
C++
20 lines
466 B
C++
#include "testlib.h"
|
|
#include <stdio.h>
|
|
#include <math.h>
|
|
|
|
const double EPS = 1E-6;
|
|
|
|
int main(int argc, char * argv[])
|
|
{
|
|
setName("compare two doubles, maximal absolute or relative error = %.10lf", EPS);
|
|
registerTestlibCmd(argc, argv);
|
|
|
|
double ja = ans.readDouble();
|
|
double pa = ouf.readDouble();
|
|
|
|
if (!doubleCompare(ja, pa, EPS))
|
|
quitf(_wa, "expected %.10lf, found %.10lf", ja, pa);
|
|
|
|
quitf(_ok, "answer is %.10lf", ja);
|
|
}
|