$OpenBSD: patch-src_libs_learning_policy_cpp,v 1.2 2016/09/20 18:18:52 pascal Exp $
--- src/libs/learning/policy.cpp.orig	Mon Apr 18 17:37:10 2016
+++ src/libs/learning/policy.cpp	Tue Sep 20 01:28:40 2016
@@ -437,7 +437,7 @@ int DiscretePolicy::SelectAction (int s, real r, int f
 					// if P[][] remains unchanged between updates.
 					// -- removed because it doesn't work! --
 					//P[i][j] += 0.01*delta * e[i][j] * (1.-P[i][j]);
-					if ((fabs (Q[i][j])>1000.0)||(isnan(Q[i][j]))) {
+					if ((fabs (Q[i][j])>1000.0)||(std::isnan(Q[i][j]))) {
 						printf ("u: %d %d %f %f\n", i,j,Q[i][j], ad * e[i][j]);
 					}
 					
@@ -523,7 +523,7 @@ void DiscretePolicy::loadFile (char* f)
 		if( readSize < (int unsigned)n_actions )
 			fprintf(stderr, "Error when reading file");
 		for (j=0; j<n_actions; j++) {
-			if ((fabs (Q[i][j])>100.0)||(isnan(Q[i][j]))) {
+			if ((fabs (Q[i][j])>100.0)||(std::isnan(Q[i][j]))) {
 				printf ("l: %d %d %f\n", i,j,Q[i][j]);
 				Q[i][j] = 0.0;
 			}
@@ -586,7 +586,7 @@ void DiscretePolicy::saveFile (char* f) {
 		if( writeSize < (int unsigned)n_actions)
 			fprintf( stderr, "Failed to write all data to file %s\n", f);
 		for (int j=0; j<n_actions; j++) {
-			if ((fabs (Q[i][j])>100.0)||(isnan(Q[i][j]))) {
+			if ((fabs (Q[i][j])>100.0)||(std::isnan(Q[i][j]))) {
 				printf ("s: %d %d %f\n", i,j,Q[i][j]);
 			}
 		}
