Making the test tougher.

This commit is contained in:
Daniel Lemire 2018-10-08 16:32:54 -04:00
parent 7eb7cd265a
commit 8f704fdb7c
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ inline void foundFloat(double result, const u8 * buf) {
parse_error |= PARSE_ERROR; parse_error |= PARSE_ERROR;
} }
// we want to get some reasonable relative accuracy // we want to get some reasonable relative accuracy
if(fabs(expected - result)/fmax(fabs(expected),fabs(result)) > 0.000000000000001) { if(fabs(expected - result)/fmin(fabs(expected),fabs(result)) > 0.000000000000001) {
printf("parsed %.32f from \n", result); printf("parsed %.32f from \n", result);
printf(" %.32s whereas strtod gives\n", buf); printf(" %.32s whereas strtod gives\n", buf);
printf(" %.32f,", expected); printf(" %.32f,", expected);