try it out:
volatile float bob = -344.0f;
unsigned int fred = (unsigned int)bob;
printf(\"%d\\n\",fred);
output will be 0.
obvious
This is to be expected - casting a negative float to an unsigned int results in undefined behaviour (UB). If you want the value to wraparound (which is also UB, BTW), then you would need to cast to a (signed) int first and then to unsigned int. Ideally you should not rely on UB at all and find a better way of doing what you need to do.