Comment Comment by nwellnhof Even worse, checking for overflow before casting can be tricky: https://stackoverflow.com/questions/526070/handling-overflow...It's sad that comparison operators in C/C++ can lead to UB. Comparing unsigned to signed ints or comparing floats to ints is something the compiler could make work reliably at very little extra cost. parent nwellnhof 3 months ago
It's sad that comparison operators in C/C++ can lead to UB. Comparing unsigned to signed ints or comparing floats to ints is something the compiler could make work reliably at very little extra cost.