long b = 99;
float c = 99.0F;
//b = c; //Error : Cannot implicitly convert type 'float' to 'long'.
c = b; // Running Successfully. Why?
为什么没有关于数据类型大小和隐式转换的问题?
的float
和long
的大小是不同的,因为我们知道,并且在下面给出...长期浮动,为什么?
Console.WriteLine("Long : " + sizeof(long)); // Output --> Long : 8
Console.WriteLine("Float : " + sizeof(float));// Output --> Float: 4
浮点数的精确长度是多少? – jak 2010-12-04 06:16:14
浮点数有23位精度。 http://en.wikipedia.org/wiki/Single_precision_floating-point_format – 2010-12-04 06:27:06