G*G
2 楼
double x=0.0;
double y
how to avoid zero division?
if (x !=0)
y=5.0/x;
or if (!x.equal(0))
y=5.0/x;
or if (Math.Abs(x) >1e-8)
y=5.0/x;
or other.
please share your opinion.
thanks.
double y
how to avoid zero division?
if (x !=0)
y=5.0/x;
or if (!x.equal(0))
y=5.0/x;
or if (Math.Abs(x) >1e-8)
y=5.0/x;
or other.
please share your opinion.
thanks.
l*a
5 楼
dark knight rises
r*l
7 楼
if (x!=0)就够了吧?如果因为精度问题x不等于0,那么除以x应该也不会出错吧?
相关阅读
被ICC坑死, 求推荐Android相关的Contractor职位mongodb 3.2 有人用吗能把pc上的单机程序转成online的么?问个屌丝的问题请教一个javascript 的问题请教一下,各位牛人觉得Rust语言怎么样?agile就是用政治绑架科学快速系统学习 c++ design pattern有什么好书或者网站吗2爷一走,groupon起来了。各位轮子派?你们用到后面不觉得蛋疼?sharing pluralsight发现IE 10连发两个websocket message,第二个自动丢失Pandas 的index真他妈的奇特问一个WPF的问题谁推荐个 machine learning 入门教程两年前面过一次LinkedIn,经历过的最傻逼的一次面试 (转载)想找个C++11的咨询师,挺难啊scrum企图颠覆的是人性CITI的网站是谁做的呀?为什么你们都歧视阿三呢?我认识的印度女生都听温柔的 (转载)