由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Computation版 - fortran 中怎样达到32位有效数字的精度?
相关主题
问个double计算精度的问题请教一个关于PDE数值解方面的问题
高精度计算问题解ODE的六阶精度Runge-Kutta法
fortran怎么处理很大的数?大家讨论讨论几种不同的计算方法吧?
Re: matlab和fortran计算结果不一样该相信谁Lapack的精度问题
懂fortran的帮忙看一下关于计算精度的问题 c++
mm is not real until explicitly declared怎么提高Matlab的计算精度?
如何在fortran中用real*16的数据?如何处理这样的精度?
!!! How to adjust precision in CPLEX !!!谁能跟我讲讲fmm
相关话题的讨论汇总
话题: real话题: 精度话题: precision话题: qp话题: 有效数字
进入Computation版参与讨论
1 (共1页)
w**t
发帖数: 1068
1
unix里,我用
f77 -r8 或 pgf90 -r8 都可以达到双精度,i.e. 16位有效数字的精度
我想问,怎样达到32位有效数字的精度?
我知道好像有类似于 f77 -r16 ,90有类似的吗?
或者code的编写里面怎样设置?好像没有 real(16) 这样的?
谢谢帮助!
l******n
发帖数: 9344
2

用SELECTED_REAL_KIND来定义精度
比如
db=SELECTED_REAL_KIND(2*kind(1.0))
real(dp) ::x
x就是双精度的

【在 w**t 的大作中提到】
: unix里,我用
: f77 -r8 或 pgf90 -r8 都可以达到双精度,i.e. 16位有效数字的精度
: 我想问,怎样达到32位有效数字的精度?
: 我知道好像有类似于 f77 -r16 ,90有类似的吗?
: 或者code的编写里面怎样设置?好像没有 real(16) 这样的?
: 谢谢帮助!

f**********g
发帖数: 117
3
双精度是 REAL(8),15 digits
real*8 variableName
or
implicit real*8(a-h,o-z)
都行
REAL(8) or DOUBLE PRECISION 8 15 digits
Negative numbers from approximately –1.797693134862316D+308 to –2.
225073858507201D–308
Zero
Positive numbers from approximately +2.225073858507201D–308 to +1.
797693134862316D+308

【在 w**t 的大作中提到】
: unix里,我用
: f77 -r8 或 pgf90 -r8 都可以达到双精度,i.e. 16位有效数字的精度
: 我想问,怎样达到32位有效数字的精度?
: 我知道好像有类似于 f77 -r16 ,90有类似的吗?
: 或者code的编写里面怎样设置?好像没有 real(16) 这样的?
: 谢谢帮助!

s***t
发帖数: 195
4
you need quadruple precision. look at
http://crd.lbl.gov/~dhbailey/mpdist/

【在 w**t 的大作中提到】
: unix里,我用
: f77 -r8 或 pgf90 -r8 都可以达到双精度,i.e. 16位有效数字的精度
: 我想问,怎样达到32位有效数字的精度?
: 我知道好像有类似于 f77 -r16 ,90有类似的吗?
: 或者code的编写里面怎样设置?好像没有 real(16) 这样的?
: 谢谢帮助!

O******e
发帖数: 734
5
If you are using a Fortran 9x compiler, see what this gives you:
print*,selected_real_kind(33,4931)
If you get a positive integer, your compiler claims to support
IEEE quad-precision real variables. If you get a negative number,
your compiler does not provide built-in support for QP.
Intel's ifort supports QP by emulation and provides QP versions
of the intrinsic functions. There is one bug that I know of in
the way QP numbers are printed--they are truncated and printed
as DP numbers, but th

【在 w**t 的大作中提到】
: unix里,我用
: f77 -r8 或 pgf90 -r8 都可以达到双精度,i.e. 16位有效数字的精度
: 我想问,怎样达到32位有效数字的精度?
: 我知道好像有类似于 f77 -r16 ,90有类似的吗?
: 或者code的编写里面怎样设置?好像没有 real(16) 这样的?
: 谢谢帮助!

m********n
发帖数: 71
6
你需要 quadruple precision
先把你的数设定为double precision。
再到settings 里, 将Defualt Real kind 设定为8。
这样一来,编译后就是32位数精度。

【在 w**t 的大作中提到】
: unix里,我用
: f77 -r8 或 pgf90 -r8 都可以达到双精度,i.e. 16位有效数字的精度
: 我想问,怎样达到32位有效数字的精度?
: 我知道好像有类似于 f77 -r16 ,90有类似的吗?
: 或者code的编写里面怎样设置?好像没有 real(16) 这样的?
: 谢谢帮助!

h*******s
发帖数: 11
7
Not all compilers support quad precision, hence the test to check the
sign of the integer returned by selected_real_kind(33,4931).

【在 m********n 的大作中提到】
: 你需要 quadruple precision
: 先把你的数设定为double precision。
: 再到settings 里, 将Defualt Real kind 设定为8。
: 这样一来,编译后就是32位数精度。

1 (共1页)
进入Computation版参与讨论
相关主题
谁能跟我讲讲fmm懂fortran的帮忙看一下
请问怎么让contour画出的图在不丢失精度的情况下保存下来mm is not real until explicitly declared
Re: anyone know how to compile a libary coded in c which any be used b如何在fortran中用real*16的数据?
<>全书下载!!! How to adjust precision in CPLEX !!!
问个double计算精度的问题请教一个关于PDE数值解方面的问题
高精度计算问题解ODE的六阶精度Runge-Kutta法
fortran怎么处理很大的数?大家讨论讨论几种不同的计算方法吧?
Re: matlab和fortran计算结果不一样该相信谁Lapack的精度问题
相关话题的讨论汇总
话题: real话题: 精度话题: precision话题: qp话题: 有效数字