iphone: floats cast to unsigned ints get set to 0 if they are negative?

前端 未结 4 866
余生分开走
余生分开走 2021-01-12 02:45

try it out:

volatile float bob = -344.0f;
unsigned int fred = (unsigned int)bob;

printf(\"%d\\n\",fred);

output will be 0.

obvious

4条回答
提交回复
热议问题