What does “real*8” mean?

后端 未结 3 1344
失恋的感觉
失恋的感觉 2020-11-30 08:31

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

3条回答
  •  忘掉有多难
    2020-11-30 09:05

    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:

    The "real*4" statement specifies the variable names to be single precision 4-byte real numbers which has 7 digits of accuracy and a magnitude range of 10 from -38 to +38. The "real" statement is the same as "real*4" statement in nearly all 32-bit computers.

    and

    The "real*8" statement specifies the variable names to be double precision 8-byte real numbers which has 15 digits of accuracy and a magnitude range of 10 from -308 to +308. The "double precision" statement is the same as "real*8" statement in nearly all 32-bit computers.

提交回复
热议问题