Removed SignedRound and replaced std::round with std::lround where needed

Also see https://clang.llvm.org/extra/clang-tidy/checks/bugprone/incorrect-roundings.html

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-07-06 01:25:08 +02:00
committed by Konstantin Pastbin
parent ae349462c6
commit 76d7ef146c
22 changed files with 67 additions and 60 deletions

View File

@@ -12,6 +12,7 @@
#include "base/thread_pool_computational.hpp"
#include <algorithm>
#include <cmath>
#include <fstream>
#include <set>
#include <vector>
@@ -188,8 +189,8 @@ public:
double lt = pos.m_lat - m_bottomLat;
lt = 1 - lt; // From North to South, the same direction as inside the SRTM tiles.
auto const row = static_cast<size_t>(std::round(kArcSecondsInDegree * lt));
auto const col = static_cast<size_t>(std::round(kArcSecondsInDegree * ln));
auto const row = std::lround(kArcSecondsInDegree * lt);
auto const col = std::lround(kArcSecondsInDegree * ln);
auto const ix = row * (kArcSecondsInDegree + 1) + col;
CHECK(ix < m_values.size(), (pos));