收起
max方法的返回值是int,而你的x是float,所以会(int)1.8得到了1,此时max返回1
(int)1.8
所以就算你(float)max(x,y)也只是对1进行强转为float,得到1.0000
(float)max(x,y)
报告相同问题?