mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-08 13:27:57 +00:00
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:
committed by
Konstantin Pastbin
parent
ae349462c6
commit
76d7ef146c
@@ -133,7 +133,7 @@ int LatToInt(double lat, int maxValue)
|
||||
// 000111111222222...LLLLLMMMM
|
||||
|
||||
double const x = (lat + 90.0) / 180.0 * maxValue;
|
||||
return x < 0 ? 0 : (x > maxValue ? maxValue : static_cast<int>(x + 0.5));
|
||||
return x < 0 ? 0 : (x > maxValue ? maxValue : std::lround(x));
|
||||
}
|
||||
|
||||
// Make lon in [-180, 180)
|
||||
|
||||
Reference in New Issue
Block a user