主题:Rekease模式下,NAN error
wooing
[专家分:0] 发布于 2011-01-23 22:40:00
以下程序,在alpha=0.0,cond=0.0 的时候,在build release模式的时候,出现cond=NAN 的错误,如果用debug模式build的话。cond会得到正确的值0.0.
大家帮忙看看什么原因。 谢谢!
*************************
tiny = 1.0E-30
a = alpha
b = one-a
cond = cond/(b+tiny)
cond2 = cond2/(a+tiny)
*************************
回复列表 (共12个回复)
11 楼
zhiqingquan [专家分:160] 发布于 2011-01-25 10:37:00
10楼说的好。
楼主的这个问题主要是编译器的性能决定的,不同的模式下编译连接过程是不同的。系统对各个变量的初值识别和处理方法也由编译器决定。
另外,插一句,我们编程的目的是解决问题,不是去研究编译器的特点。编程的时候要尽量简洁易读易改易调试,即使编译器有bug,我们尽量避开它,得到我们所要求的目标程序就好。
fortran的指针功能不行,建议尽量不用。
12 楼
sabsa [专家分:0] 发布于 2011-01-25 11:57:00
The popularity [url=http://www.mmopowerlevel.net]wow power leveling[/url] of modern stone massage has meant that [url=http://www.mogxe.com/PowerLevel.php?gid=1]wow power leveling[/url] there’s a large increase in [url=http://www.mmopowerlevel.net/powerlist.php?fid=688]wow power leveling[/url] the number of spas and massage therapists [url=http://www.mogxe.com]wow power leveling[/url] offering this treatment. With all these [url=http://www.mogxe.com/PowerLevel.php?gid=21]aion power level[/url] options, be sure you choose an establishment with qualified practitioners and sanitary equipment. The stones used [url=http://www.mogxe.com/PowerLevel.php?gid=21]aion powerleveling[/url] in this form of therapy are re-used and if they’re not cleaned properly following [url=http://www.mogxe.com/BuyGold.php?gid=1]buy wow gold[/url] individual use, they may become a breeding ground for germs and disease.
Stone massage has come a long way from [url=http://www.mogxe.com/BuyGold.php?gid=21]aion kinah[/url] its ancient roots in Chinese and Hawaiian cultures, and this form of massage is now viewed as a particularly [url=http://www.mmopowerlevel.net/powerlist.php?fid=7422]aion power level[/url] beneficial and relaxing form of massage. Those seeking a deeper form of connection to their [url=http://www.mmopowerlevel.net/buy.php]wow gold uk[/url] bodies will reap great benefits from receiving a stone massage, whether the rocks are heated or chilled.
我来回复