This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
float 变量 b.
在memory 中的值为
在watch expression 中的值却是:
程序是:
asm(" MOVW DP, #0x305");
asm(" MOV ACC, @0x03");
asm(" SUB ACC, #32768");
asm(" MOVL @0x34, ACC");
上面已经回复,你可以在watch expression下的变量名type中右键选择number format下的hex看看。
不显示hex是因为该变量本身的类型被你定义成float,所以default的就是float值,而在内存中,只能显示2或16进制。
浮点数 116C 怎么算出是6.249791e-42?
内存中的数:0 000, 0000,0 000, 0000,0001,0001,0110,1100
符号位:0
幂:0-127=-127
尾数:1.000 0000 0001 0001 0110 1100
浮点数(1.000 0000 0001 0001 0110 11)*2^(-127)
算出来不等于6.249791e-42。请问正确算法
楼主的算法是正确的,估计CCS本身溢出了吧。
找个简单的验证,4170 0000
0 1000 0010 . 111 0000 0000 0000 0000 0000 =按IEEE的算法为15