diff --git a/src/cache.h b/src/cache.h
index 1507a4045505b2f663a678ab95cdf3d8e4247b82..5f2be08ddb0dce3f055b187a0dd4e43cb713ee67 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -369,9 +369,9 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
   }
 
 #ifdef SWIFT_DEBUG_CHECKS
-  const double shift_threshold_x = 4. * ci->width[0] * (1. + 2.*space_maxreldx);
-  const double shift_threshold_y = 4. * ci->width[1] * (1. + 2.*space_maxreldx);
-  const double shift_threshold_z = 4. * ci->width[2] * (1. + 2.*space_maxreldx);
+  const float shift_threshold_x = 4. * ci->width[0] * (1. + 2.*space_maxreldx);
+  const float shift_threshold_y = 4. * ci->width[1] * (1. + 2.*space_maxreldx);
+  const float shift_threshold_z = 4. * ci->width[2] * (1. + 2.*space_maxreldx);
 
   /* Make sure that particle positions have been shifted correctly. */
   for (int i = 0; i < ci_cache_count; i++) {