double x=1/(1.0/0);pass;result:0.0
float x=1/(1.0/0);error;reason:float x=1/(float)(1.0/0);pass;result:0.0but
double x=1.0/0 infinity why?
float x=1/0 error why?
int x=1/0 error why?
float x=1/(1.0/0);error;reason:float x=1/(float)(1.0/0);pass;result:0.0but
double x=1.0/0 infinity why?
float x=1/0 error why?
int x=1/0 error why?
/0 这个0应该是整的吧,是不是返回double就把0当double看?
说得有点不对吧,double、float存的虽然都是不精确的数
但是0就是0.0,是比较精确的,float x=0;
System.out.println(x);输出的结果是0.0
而不是什么0.0000000002而且虽然0.0000000002很小,但是1.0/0.0000000002也不会得到无穷大,挺多是溢出。我也不太明白,关注中