Skip to content

Commit

Permalink
Static cast to float after division.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp authored Oct 1, 2023
1 parent b0f117d commit 0412b85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parallel_hashmap/phmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,7 @@ class raw_hash_set

size_t bucket_count() const { return capacity_; }
float load_factor() const {
return capacity_ ? static_cast<float>(size()) / capacity_ : 0.0f;
return capacity_ ? static_cast<float>(static_cast<double>(size()) / capacity_) : 0.0f;
}
float max_load_factor() const { return 1.0f; }
void max_load_factor(float) {
Expand Down

0 comments on commit 0412b85

Please sign in to comment.