小编Bri*_*oco的帖子

unsigned u = *(unsigned*)&x; 是什么意思?在 C++ 中,其中 x 是浮点变量?

由于我的数值分析课程考试临近,我正在寻找在 C/C++ 中表示浮点数的实现代码?然后我在github上找到了一行代码。您能告诉我,下面代码片段中第二行的含义是什么,以及它为何如此重要?

float x = ...;
unsigned u = *(unsigned*)&x; 
Run Code Online (Sandbox Code Playgroud)

c++ floating-point unsigned numerical-methods

1
推荐指数
1
解决办法
377
查看次数

标签 统计

c++ ×1

floating-point ×1

numerical-methods ×1

unsigned ×1