diff --git a/src/environment.cpp b/src/environment.cpp
index ce25b0fe7f71eadb18ede0da35071d58130faf6c..1951996a23135f0330aa6c40f1dc4e313e03e56d 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -592,7 +592,7 @@ class ABMHandler
 			float chance = abm->getTriggerChance();
 			if(chance == 0)
 				chance = 1;
-			aabm.chance = 1.0 / pow(1.0 / chance, intervals);
+			aabm.chance = 1.0 / pow((float)1.0/chance, (float)intervals);
 			if(aabm.chance == 0)
 				aabm.chance = 1;
 			std::set<std::string> contents_s = abm->getTriggerContents();