本文介绍了什么是“真实* 8”意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用Fortran 90编写的程序手册说:所有的实际变量和参数都是以64位精度指定的(即 real * 8 )。

p>

根据,单精度对应到32位精度,而双精度对应于64位精度,所以程序显然使用双精度。

但 real * 8 是什么意思?

我认为 8 意味着8位数字在小数点后面。然而,似乎表示,单精度通常提供6-9位数,而通常提供15-17位数字。这是否意味着64位精度语句与 real * 8 不一致?

解决方案

8表示数据类型使用的字节数



所以,一个32位整数是整数* 4 沿着同一行。



快速搜索发现,其中包括:
$ b


The manual of a program written in Fortran 90 says, "All real variables and parameters are specified in 64-bit precision (i.e. real*8)."

According to Wikipedia, single precision corresponds to 32-bit precision, whereas double precision corresponds to 64-bit precision, so apparently the program uses double precision.

But what does real*8 mean?

I thought that the 8 meant that 8 digits follow the decimal point. However, Wikipedia seems to say that single precision typically provides 6-9 digits whereas double precision typically provides 15-17 digits. Does this mean that the statement "64-bit precision" is inconsistent with real*8?

解决方案

The 8 refers to the number of bytes that the data type uses.

So a 32-bit integer is integer*4 along the same lines.

A quick search found this guide to Fortran data types, which includes:

and

这篇关于什么是“真实* 8”意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 17:42
查看更多