diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index a62fd049..e869cbf0 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -627,7 +627,7 @@ public: return arrays.elements?(arrays.groups_size_mask+1)*N-1:0; } - float load_factor()const noexcept{return float(size())/capacity();} + float load_factor()const noexcept{return float(size())/float(capacity());} float max_load_factor()const noexcept{return mlf;} void rehash(std::size_t n) @@ -737,7 +737,7 @@ private: else { float fml=mlf*(float)(capacity()); auto res=(std::numeric_limits::max)(); - if(res>fml)res=(std::size_t)fml; + if(res>(std::size_t)fml)res=(std::size_t)fml; return res; } }