When can Java produce a NaN?

前端 未结 4 1837
太阳男子
太阳男子 2020-12-20 15:33

I know what Java Double.NaN is. I have some Java code that produces NaN.

// calculate errors
delta = m1 + m2 - M;
eta = f1 + f2          


        
4条回答
  •  忘掉有多难
    2020-12-20 16:20

    Have you tried sprinkling your code with System.out.println statements to determine exactly where NaNs start occuring?

提交回复
热议问题