Casting a negative float to an unsigned int
Never cast a negative float
to an unsigned int
. The result of the cast differs depending on whether the cast is executed on a device with Intel or ARM architecture. The C++ Standard decrees that the result of such a cast is undefined.