不是数字翻倍 [英] not a number double

查看:71
本文介绍了不是数字翻倍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么

距离+ = Math.sqrt(Math.pow((double)wiersz_analiz owany [i],(double)2)-Math.pow((double)czyNajblizszySasiad [i],(双)2));


返回NaN


谢谢你

why
distance+=Math.sqrt(Math.pow((double)wiersz_analiz owany[i],(double)2)-Math.pow((double)czyNajblizszySasiad[i],(double)2));

returns NaN

thank YOU

推荐答案


为什么

距离+ = Math.sqrt(Math.pow((double)wiersz_analiz owany [i],(double)2)-Math.pow ((double)czyNajblizszySasiad [i],(double)2));


返回NaN


谢谢你
why
distance+=Math.sqrt(Math.pow((double)wiersz_analiz owany[i],(double)2)-Math.pow((double)czyNajblizszySasiad[i],(double)2));

returns NaN

thank YOU



还记得穷人的调试器System.out.println()吗?应用它。

(暗示:负值不适合Math.sqrt()方法)。


亲切的问候,


Jos

Remember the poor men''s debugger System.out.println()? Apply it.
(hint: negative values don''t go well for the Math.sqrt() method).

kind regards,

Jos


正确。

制作一个循环...

系统,out。 println(czyNajblizszySasiad [i])

Correct.
make a loop and ...
System,out.println(czyNajblizszySasiad[i])


还记得穷人的调试器System.out.println()吗?应用它。

(暗示:负值不适合Math.sqrt()方法)。


亲切的问候,


Jos
Remember the poor men''s debugger System.out.println()? Apply it.
(hint: negative values don''t go well for the Math.sqrt() method).

kind regards,

Jos


我做了system.out.printlns并且值正确它们是0,1,2或3

因为测试数据是由0 1 2或3个值组成的行
i did system.out.printlns and the values are correct they are 0 ,1 ,2 or 3
because test data are rows consisted of 0 1 2 or 3 values


这篇关于不是数字翻倍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆