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位数精度。
|