Skip to content

Commit

Permalink
Add missing casts
Browse files Browse the repository at this point in the history
  • Loading branch information
gvinciguerra committed May 13, 2023
1 parent e8ccbed commit 1b062ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/pgm/pgm_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ struct PGMIndex<K, Epsilon, EpsilonRecursive, Floating>::Segment {
* @return the approximate position of the specified key
*/
inline size_t operator()(const K &k) const {
auto pos = int64_t(slope * (k - key)) + intercept;
auto pos = int64_t(slope * double(k - key)) + intercept;
return pos > 0 ? size_t(pos) : 0ull;
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/pgm/pgm_index_variants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ class MultidimensionalPGMIndex {
auto k_range_end = [&]<std::size_t... indices>(uint64_t dist, std::index_sequence<indices...>) -> value_type{
value_type point;
swallow{
(std::get<indices>(point) = std::min(std::get<indices>(p) + dist, this->data.size()), 0)...
(std::get<indices>(point) = std::min<uint64_t>(std::get<indices>(p) + dist, this->data.size()), 0)...
};
return point;
};
Expand Down

0 comments on commit 1b062ec

Please sign in to comment.