rap*_*yen 1 c floating-point overflow char
不确定如何判断溢出是否可能.我得到了这个示例代码:
char x;
float f, g;
// some values get assigned to x and f here...
g = f + x;
Run Code Online (Sandbox Code Playgroud)
有人可以解释一下吗?
A float,在其最高限制(二进制指数为127)时,没有足够的精度(23位)来显示最大可能char(127,7位)的差异,因此无法溢出,因为加法不起作用(需要127-7 = 120的精度.