diff --git a/modules/mol/alg/src/trajectory_analysis.cc b/modules/mol/alg/src/trajectory_analysis.cc
index 1ef9b565142bc48336dc4c76e1ce7e4e37100539..96dd5fabb0599b77fb68fa4d9ca8dea94a8de313 100644
--- a/modules/mol/alg/src/trajectory_analysis.cc
+++ b/modules/mol/alg/src/trajectory_analysis.cc
@@ -331,7 +331,7 @@ std::vector<Real> AnalyzeAromaticRingInteraction(const CoordGroupHandle& traj, c
     if (to<from) {
       throw Error("to smaller than from");
     }
-    unsigned int n_frames=ceil((to-from)/stride);
+    unsigned int n_frames=ceil((to-from)/static_cast<Real>(stride));
     if (n_atoms==0){
       throw Error("EntityView is empty");
     }
@@ -370,7 +370,7 @@ std::vector<Real> AnalyzeAromaticRingInteraction(const CoordGroupHandle& traj, c
     if (to<from) {
       throw Error("to smaller than from");
     }
-    unsigned int n_frames=ceil((to-from)/stride);
+    unsigned int n_frames=ceil((to-from)/static_cast<Real>(stride));
     if (n_atoms==0){
       throw Error("EntityView is empty");
     }