diff options
-rw-r--r-- | binsearch_closest/binsearch_closest.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/binsearch_closest/binsearch_closest.hpp b/binsearch_closest/binsearch_closest.hpp index 3db703f..b8a7004 100644 --- a/binsearch_closest/binsearch_closest.hpp +++ b/binsearch_closest/binsearch_closest.hpp @@ -58,7 +58,7 @@ ssize_t binsearch_closest(const std::vector<T> vec, T val) if (imax - imin == 1 && std::abs(vec.at(imax) - val) < std::abs(vec.at(imin) - val)) imin = imax; - return (ssize_t)imin; + return static_cast<ssize_t>(imin); } #endif /* __BINSEARCH_CLOSEST_HPP__ */ |