Browse Source

Use fabs instead of abs for double values. Also add missing include.

Terry Cojean 9 years ago
parent
commit
7c9d8feb8f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      examples/pi/pi_redux.c

+ 2 - 1
examples/pi/pi_redux.c

@@ -26,6 +26,7 @@
 
 #include <starpu.h>
 #include <stdlib.h>
+#include <math.h>
 
 #define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
 #define PI	3.14159265358979323846
@@ -405,7 +406,7 @@ int main(int argc, char **argv)
 
 	starpu_shutdown();
 
-	if (abs(pi_approx - PI) > 1.0)
+	if (fabs(pi_approx - PI) > 1.0)
 		return 1;
 
 	return 0;