Do not convert float value to integer if it will over/underflow. The comparison cannot be `<=` since rounding may overflow it. Fixes #10436