CUDA type casting unexpected behaviour

Hi, can anyone explain why the cuda type casting functions behave differently from standard C++ on CPU, for example:
0x86’?’ = unsigned char( 0x86 )
C++ CPU:
0x1f’\x1f’ = unsigned char( 0x86 )
and CUDA int() and CUDA float() behave differently from CPU int() and float() too. Why is that?
Moreover, I notice that there is a small difference even between _float2int_rd() and CPU int(), too.

__float2int_rd() is not the same as regular float -> int conversion. The C and C++ standards specify that float -> int conversion truncates, so the equivalent intrinsic would be __float2int_rz(). The suffix “_rd” means “round down” / “round towards negative infinity”, while “_rz” means “round towards zero”.

I don’t understand your first question. Could you post a compilable example code that demonstrates the difference(s) you are concerned about?

Sorry it’s garbage. I made a stupid mistake. the type casting function of CUDA c++ and standard c++ are exactly the same, and __float2int_rd() are round half down function which is unrelated to the topic.