小编Arn*_*aud的帖子

我的浮动值与C中的值不匹配

我正在尝试将木板与覆盆子连接。我必须通过modbus来将值读/写到板上,但是不能像板一样写浮点值。

我正在使用C和Eclipse调试透视图来直接查看变量的值。董事会寄给我0x46C35000至12月应值25'000,但日食显示我1.18720512e + 009 ...

当我在此网站上尝试http://www.binaryconvert.com/convert_float.html?hexadecimal=46C35000时,我得到25,000。

有什么问题 ?出于测试目的,我正在使用:

int main(){

    while(1){ // To view easily the value in the debug perspective 
        float test = 0x46C35000;
        printf("%f\n",test);
    }
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

谢谢 !

c floating-point

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

标签 统计

c ×1

floating-point ×1