Fix conversion range check for floating-point to unsigned
When converting floating-point to any integer type, the fractional part is discarded, so any value in the range (-1.0,-0.00) (exclusive) will truncate to -0.0, and so will fit in an unsigned destination type. See https://en.cppreference.com/w/cpp/language/implicit_conversion#Floating.E2.80.93integral_conversions. Change-Id: Id8a5263d486cc3cd25670da27c417c66e28fccdd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2488717Reviewed-by:Tom Sepez <tsepez@chromium.org> Commit-Queue: Zhi An Ng <zhin@chromium.org> Cr-Commit-Position: refs/heads/master@{#819633}
Showing
Please register or sign in to comment