Explorar o código

examples/reductions/dot_product: fix result checking.

Cyril Roelandt %!s(int64=13) %!d(string=hai) anos
pai
achega
5752d326a0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      examples/reductions/dot_product.c

+ 1 - 1
examples/reductions/dot_product.c

@@ -421,7 +421,7 @@ int main(int argc, char **argv)
 	free(x_handles);
 	free(y_handles);
 
-	if (fabs(reference_dot - dot) < 1e-4)
+	if (fabs(reference_dot - dot) < reference_dot * 1e-6)
 		return EXIT_SUCCESS;
 	else
 		return EXIT_FAILURE;