diff --git a/include/hpp/fcl/collision_data.h b/include/hpp/fcl/collision_data.h
index 9641f7230f73cfe15780f9786432ed095c94dba8..88ed5d23949ef53f4c8a54375fa72c6f069d589d 100644
--- a/include/hpp/fcl/collision_data.h
+++ b/include/hpp/fcl/collision_data.h
@@ -348,7 +348,7 @@ public:
                  std::numeric_limits<FCL_REAL>::max()):
   min_distance(min_distance_), o1(NULL), o2(NULL), b1(NONE), b2(NONE)
   {
-    Vec3f nan; nan << sqrt (-1), sqrt (-1), sqrt (-1);
+    Vec3f nan (Vec3f::Constant(std::numeric_limits<FCL_REAL>::quiet_NaN()));
     nearest_points [0] = nearest_points [1] = normal = nan;
   }
 
diff --git a/src/narrowphase/details.h b/src/narrowphase/details.h
index dea627e4019b92636be42cc14de56ba649c94a14..ee654943ab14cf258533fecef8366f6ba74f66f2 100644
--- a/src/narrowphase/details.h
+++ b/src/narrowphase/details.h
@@ -351,7 +351,8 @@ namespace fcl {
       assert (radius >= 0);
       Vec3f p1_to_center = center - P1;
       FCL_REAL distance_from_plane = p1_to_center.dot(normal);
-      Vec3f closest_point; closest_point << sqrt (-1), sqrt (-1), sqrt (-1);
+      Vec3f closest_point
+        (Vec3f::Constant(std::numeric_limits<FCL_REAL>::quiet_NaN()));
       FCL_REAL min_distance_sqr, distance_sqr;
 
       if(distance_from_plane < 0) {