On 16/05/18 11:18, Stephan Bergmann wrote:
while std::lround returns long.
For the latter, "[i]f the rounded value is outside the range of the
return type, the numeric result is unspecified" (C11). So the proposed
tests would not work (and should not really be of interest for us,
anyway, as the FRound versions cause UB to begin with).
=) fair enough.
For cases where the FRound version wouldn't have caused UB anyway
because the value was outside the range of long, I /think/ using
std::lround is a correct replacement.
Hopefully we'll get similar UB ;-) but sounds like you're pro the change.
Further thoughts most welcome, but sounds positive.
Thanks !
Michael.
--
michael.meeks@collabora.com <><, Pseudo Engineer, itinerant idiot
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.