Round floats using round(x), not static_cast<int>(x + 0.5)
Forwarded: yes
Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/
d96e287417766deddbff2d01b96321288c59491e
Adding 0.5 to an IEEE float may cause one bit of precision loss, which
is enough to change the result in certain cases. For example,
static_cast<int>(std::round(0.
49999999999999994)) == 0
static_cast<int>(0.
49999999999999994 + 0.5) == 1
The author works at Google. Upstream applied this patch as Piper
revision
369926519 and exported it to GitHub; the Applied-Upstream URL
above points to the exported commit.
Gbp-Pq: Name float-rounding.diff