Redian新闻
>
Re: matlab和fortran计算结果不一样该相信谁
avatar
Re: matlab和fortran计算结果不一样该相信谁# Computation - 科学计算
r*y
1
Even on a same machine, different compilers of same language
can give you different results beyond machine precision. There is also no
point to compare fortran and matlab results beyond machine precision.
And pi in matlab is not same as the pi you specified in your code.
As I said before, your code sucks, not fortran or matlab.


8888
.

avatar
c*e
2
matlab always uses double precision in computing, so I would like to
believe matlab, hehe.

【在 r****y 的大作中提到】
: Even on a same machine, different compilers of same language
: can give you different results beyond machine precision. There is also no
: point to compare fortran and matlab results beyond machine precision.
: And pi in matlab is not same as the pi you specified in your code.
: As I said before, your code sucks, not fortran or matlab.
:
: 的
: 8888
: .
: 差

avatar
t*e
3


8888
.


your Pi value is not accrate enough. Change it to
mypi=4.q0*atan(1.q0)
and see if it makes any difference.
avatar
g*s
4
thank a lot! I just found it too.

【在 t*****e 的大作中提到】
:
: 的
: 8888
: .
: 差
: 题
: your Pi value is not accrate enough. Change it to
: mypi=4.q0*atan(1.q0)
: and see if it makes any difference.

avatar
g*s
5
Thanks a lot!
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。